后期绑定展望

编程入门 行业动态 更新时间:2024-10-28 14:25:40
本文介绍了后期绑定展望的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嘿, 我很难找到一些很好的后期绑定示例 Outlook中的C#。有人知道那里有什么好的网站吗?我已经用谷歌搜索过了,但是有点空了。但是有点空了。 它必须是对你有远见的。 我需要能够打开现有的联系人文件夹或创建一个新的联系人 文件夹,并添加新的联系人。 谢谢!

Hey, I''m having a difficult time finding some good examples of late binding Outlook in C#. Anyone know of any good sites out there? I''ve googled and MSDN''ed, but have come up a bit empty. IT MUST BE LATE-BINDING THOUGH. I need to be able to open an existing contact folder or create a new contact folder, and add new contacts to it. Thanks!

推荐答案

John, 您是否遇到使用反射的问题,或者只是对象模型 的前景?如果是后者,那么请查看MSDN上名为 从Visual Basic应用程序自动化Outlook的文章,位于(注意 换行): msdn.microsoft/library/de...pplication.asp 它会给你一个基本的想法对象模型,应该引导你 更详细的参考文献。 如果你正在寻找有关反射的参考,那么看看 .NET Framework开发人员指南中标题为Reflection Overview的部分, 位于(注意换行): http:// msdn。 microsoft/library/de ... onOverview.asp 希望这会有所帮助。 - - Nicholas Paldino [.NET / C#MVP] - mv*@spam.guard.caspershouse John Smith < js@no>在消息中写道 新闻:O1 **************** @ TK2MSFTNGP15.phx.gbl ... John, Are you having problems with using reflection, or just the object model of outlook? If it is the latter, then check out the article on MSDN titled "Automating Outlook from a Visual Basic Applications", located at (watch for line wrap): msdn.microsoft/library/de...pplication.asp It will give you a basic idea of the object model, and should lead you to more detailed references. If you are looking for a reference on reflection, then check out the section of the .NET Framework developers guide titled "Reflection Overview", located at (watch for line wrap): msdn.microsoft/library/de...onOverview.asp Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse "John Smith" <js@no> wrote in message news:O1****************@TK2MSFTNGP15.phx.gbl... 嘿, 我很难找到一些C#后期绑定的好例子。有人知道那里有什么好的网站吗?我已经用谷歌搜索过了,但是已经有点空了。 它必须是对你很有帮助的。 我需要能够打开现有的联系人文件夹或创建一个新的联系人文件夹,并添加新的联系人。 谢谢! Hey, I''m having a difficult time finding some good examples of late binding Outlook in C#. Anyone know of any good sites out there? I''ve googled and MSDN''ed, but have come up a bit empty. IT MUST BE LATE-BINDING THOUGH. I need to be able to open an existing contact folder or create a new contact folder, and add new contacts to it. Thanks!

谢谢Nicholas。 我想我更多的只是寻找例子,因为我期待的方式 工作的东西,目前不是。例如,下面的 第四行(尝试获取默认文件夹时)失败,但未指定 异常。我确定这个错误很小,但是有些例子肯定会加速我的调试: 类型oType = Type.GetTypeFromProgID(" Outlook.Application") ; Object oApp = Activator.CreateInstance(oType); Object oNameSpace = oApp.GetType()。InvokeMember(" GetNamespace" , BindingFlags.GetProperty,null,oApp,new object [1] {" MAPI"}); Object oFolder = oNameSpace.GetType() .InvokeMember(" GetDefaultFolde r", BindingFlags.GetProperty,null,oNameSpace,null); Object oAllFolders = oFolder.GetType()。InvokeMember (文件夹, BindingFlags.GetProperty,null,oFolder,null); Object oCurFolder = oAllFolders.GetType()。InvokeMember("添加", BindingFlags.InvokeMethod,null,oAllFolders,new object [1] {" folderName"}); " Nicholas Paldino [。 NET / C#MVP]" < mv*@spam.guard.caspershouse>写在 消息新闻:#G ************** @ tk2msftngp13.phx.gbl ... Thanks Nicholas . I guess I''m more just looking for examples because the way that I expect things to work, currently is not. For instance, the below fails on the fourth line (while trying to get the default folder) with an unspecified exception. I''m sure the mistake is small, but some examples sure would speed up my debugging: Type oType = Type.GetTypeFromProgID("Outlook.Application"); Object oApp = Activator.CreateInstance(oType); Object oNameSpace = oApp.GetType().InvokeMember("GetNamespace", BindingFlags.GetProperty, null, oApp, new object[1]{"MAPI"}); Object oFolder = oNameSpace.GetType().InvokeMember("GetDefaultFolde r", BindingFlags.GetProperty, null, oNameSpace, null); Object oAllFolders = oFolder.GetType().InvokeMember("Folders", BindingFlags.GetProperty, null, oFolder, null); Object oCurFolder = oAllFolders.GetType().InvokeMember("Add", BindingFlags.InvokeMethod, null, oAllFolders, new object[1]{"folderName"}); "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse> wrote in message news:#G**************@tk2msftngp13.phx.gbl... John,的outlook模型?如果是后者,请查看MSDN 上标题为从Visual Basic应用程序自动化Outlook的文章,位于(观看换行): http ://msdn.microsoft/library/de...pplication.asp 它将为您提供对象模型的基本概念,并应引导您更详细的参考资料。 如果您正在寻找有关反射的参考,请查看位于(手表)的反思概述的.NET Framework开发人员指南的部分。用于换行): msdn.microsoft/library/de...onOverview.asp 希望这会有所帮助。 - - Nicholas Paldino [.NET / C#MVP] - mv*@spam.guard.caspershouse。 com John Smith < js@no>在消息中写道新闻:O1 **************** @ TK2MSFTNGP15.phx.gbl ... John, Are you having problems with using reflection, or just the object model of outlook? If it is the latter, then check out the article on MSDN titled "Automating Outlook from a Visual Basic Applications", located at (watch for line wrap): msdn.microsoft/library/de...pplication.asp It will give you a basic idea of the object model, and should lead you to more detailed references. If you are looking for a reference on reflection, then check out the section of the .NET Framework developers guide titled "Reflection Overview", located at (watch for line wrap): msdn.microsoft/library/de...onOverview.asp Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse "John Smith" <js@no> wrote in message news:O1****************@TK2MSFTNGP15.phx.gbl... 嘿, <我很难找到一些关于C#后期绑定的好例子。有人知道那里有什么好的网站吗?我用谷歌搜索了和MSDN',但是有点空了。 它必须是那么晚的结合。 我需要能够打开现有的联系人文件夹或创建一个新的联系人文件夹,并添加新的联系人。 谢谢! Hey, I''m having a difficult time finding some good examples of late binding Outlook in C#. Anyone know of any good sites out there? I''ve googled and MSDN''ed, but have come up a bit empty. IT MUST BE LATE-BINDING THOUGH. I need to be able to open an existing contact folder or create a new contact folder, and add new contacts to it. Thanks!

顺便说一句,该行的问题是我没有把它传递给文件夹 type(在这种情况下联系... Outlook.OlDefaultFolders.olFolderContac ts), 但我不知道我应该使用什么常数。 约翰史密斯 < js@no>在消息中写道 新闻:#B ************** @ TK2MSFTNGP09.phx.gbl ... The problem with that line by the way is that I''m not passing it the folder type (in this case contacts...Outlook.OlDefaultFolders.olFolderContac ts), but I don''t know what constant I should use for that. "John Smith" <js@no> wrote in message news:#B**************@TK2MSFTNGP09.phx.gbl... 谢谢Nicholas。 我想我更多的只是寻找例子,因为我希望工作的方式,目前不是。例如,下面的第四行(在尝试获取默认文件夹时)失败并带有未指定的异常。我确定错误很小,但有些例子肯定会加快我的调试速度:输入oType = Type.GetTypeFromProgID(" Outlook.Application"); Object oApp = Activator.CreateInstance(oType); Object oNameSpace = oApp.GetType()。InvokeMember(" GetNamespace", BindingFlags.GetProperty,null,oApp,new object [ 1] {" MAPI"}}; 对象oFolder = oNameSpace.GetType()。InvokeMember(" GetDefaultFolde r", BindingFlags.GetProperty,null,oNameSpace,null); 对象oAllFolders = oFolder.GetType()。InvokeMember(" Folders", BindingFlags.GetProperty,null,oFolder,null); 对象oCurFolder = oAllFolders.GetType()。InvokeMember(" Add", BindingFlags.InvokeMethod,null,oAllFolders,new object [1] {" folderName"}); Nicholas Paldino [.NET / C#MVP]" < mv*@spam.guard.caspershouse>在消息新闻中写了:#G ************** @ tk2msftngp13.phx.gbl ... Thanks Nicholas . I guess I''m more just looking for examples because the way that I expect things to work, currently is not. For instance, the below fails on the fourth line (while trying to get the default folder) with an unspecified exception. I''m sure the mistake is small, but some examples sure would speed up my debugging: Type oType = Type.GetTypeFromProgID("Outlook.Application"); Object oApp = Activator.CreateInstance(oType); Object oNameSpace = oApp.GetType().InvokeMember("GetNamespace", BindingFlags.GetProperty, null, oApp, new object[1]{"MAPI"}); Object oFolder = oNameSpace.GetType().InvokeMember("GetDefaultFolde r", BindingFlags.GetProperty, null, oNameSpace, null); Object oAllFolders = oFolder.GetType().InvokeMember("Folders", BindingFlags.GetProperty, null, oFolder, null); Object oCurFolder = oAllFolders.GetType().InvokeMember("Add", BindingFlags.InvokeMethod, null, oAllFolders, new object[1]{"folderName"}); "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse> wrote in message news:#G**************@tk2msftngp13.phx.gbl... John, John, Are you having problems with using reflection, or just the object

模型

的前景?如果是后者,请查看MSDN上的文章 of outlook? If it is the latter, then check out the article on MSDN

标题为

从Visual Basic应用程序自动化Outlook,位于(watch "Automating Outlook from a Visual Basic Applications", located at (watch

for

for

换行): line wrap):

msdn.microsoft/library/de...pplication.asp

它将为您提供对象模型的基本概念,并且应该引导你 It will give you a basic idea of the object model, and should lead you 更详细的参考资料。 如果您正在寻找有关反射的参考,请查看标题为.NET Framework开发人员指南的部分。 Reflection to more detailed references. If you are looking for a reference on reflection, then check out the section of the .NET Framework developers guide titled "Reflection

Overview",

Overview",

位于(注意换行): located at (watch for line wrap):

msdn.microsoft/library/de...onOverview.asp

希望这会有所帮助。 - - Nicholas Paldino [.NET / C#MVP] - mv*@spam.guard.caspershouse John Smith < js@no>在消息中写道新闻:O1 **************** @ TK2MSFTNGP15.phx.gbl ... Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse "John Smith" <js@no> wrote in message news:O1****************@TK2MSFTNGP15.phx.gbl... 嘿, <我很难找到一些关于C#后期绑定的好例子。有人知道那里有什么好的网站吗?我已经用Google搜索 Hey, I''m having a difficult time finding some good examples of late binding Outlook in C#. Anyone know of any good sites out there? I''ve googled

和MSDN'了,但是有点空了。 它必须是对你有远见的。 我需要能够打开现有的联系人文件夹或创建一个新的联系人文件夹,并添加新的联系人。 谢谢!

and MSDN''ed, but have come up a bit empty. IT MUST BE LATE-BINDING THOUGH. I need to be able to open an existing contact folder or create a new contact folder, and add new contacts to it. Thanks!

更多推荐

后期绑定展望

本文发布于:2023-08-04 17:45:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1298342.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   后期

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!