后期绑定展望 [英] Late Binding Outlook

查看:61
本文介绍了后期绑定展望的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,


我很难找到一些很好的后期绑定示例

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的文章,位于(注意

换行):

http://msdn.microsoft.com/library/de...pplication.asp


它会给你一个基本的想法对象模型,应该引导你

更详细的参考文献。


如果你正在寻找有关反射的参考,那么看看

.NET Framework开发人员指南中标题为Reflection Overview的部分,

位于(注意换行):

http:// msdn。 microsoft.com/library/de ... onOverview.asp


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com


John Smith < js@no.com>在消息中写道

新闻: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):

http://msdn.microsoft.com/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):

http://msdn.microsoft.com/library/de...onOverview.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"John Smith" <js@no.com> 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.com>写在

消息新闻:#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.com> wrote in
message news:#G**************@tk2msftngp13.phx.gbl...
John,的outlook模型?如果是后者,请查看MSDN
上标题为从Visual Basic应用程序自动化Outlook的文章,位于(观看
换行):

http ://msdn.microsoft.com/library/de...pplication.asp
它将为您提供对象模型的基本概念,并应引导您更详细的参考资料。

如果您正在寻找有关反射的参考,请查看位于(手表)的反思
概述的.NET Framework开发人员指南的
部分。用于换行):

http://msdn.microsoft.com/library/de...onOverview.asp
希望这会有所帮助。

-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse。 com

John Smith < js@no.com>在消息中写道
新闻: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):

http://msdn.microsoft.com/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):

http://msdn.microsoft.com/library/de...onOverview.asp
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"John Smith" <js@no.com> 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.com>在消息中写道

新闻:#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.com> 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.com>在消息新闻中写了
:#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.com> 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):


http://msdn.microsoft.com/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):


http://msdn.microsoft.com/library/de...onOverview.asp


希望这会有所帮助。

-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com

John Smith < js@no.com>在消息中写道
新闻:O1 **************** @ TK2MSFTNGP15.phx.gbl ...

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"John Smith" <js@no.com> 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!





这篇关于后期绑定展望的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆