1

I need interop in my programs to automate several functions in Word and Outlook. Does anyone know a good place to start. My goal is to kick off a mail merge, create several different files and save them accordingly, then e-mail the different files to different people based upon who needs what. Any help learning how to use the interop properly would be greatly appreciated.

I am currently using Visual Studio 2008 and Office 2007 and use vb.net to write my programs.

4

3 回答 3

2

开始的一个好方法是使用宏编辑器记录您尝试执行的步骤。您可以获取生成的宏代码并对其进行修改以适应您的目的。单击您不知道用途的函数和变量的名称,然后按“F1”以获取特定于上下文的帮助。

于 2009-04-28T21:05:03.530 回答
1

添加对 Outlook 12.0 对象库和 Word 12.0 对象库的 COM 引用。

这个网页真的帮助我开始了:http: //support.microsoft.com/kb/316383

然后,通过录制宏,您将公开很多您可能想要使用的东西。然而,警告是,并非所有在 VBA(宏)中公开的内容都可以在 VB .NET 中访问。我不知道为什么会这样,但实际上我必须在 Excel 中从 VB.NET 构建和执行一个宏,用 VBA 编写,以完成一些看起来非常容易的事情,如果不是因为它们之间的奇怪断开连接二。

有关邮件合并的一些好信息:http: //support.microsoft.com/kb/258512

这是一篇文章,其中包含一些基本步骤,可帮助您启动并连接 Outlook 的互操作:http: //support.microsoft.com/kb/313787

希望这可以帮助。我会留意你的问题——我想说我在互操作方面知道很多。

于 2010-04-29T18:35:11.487 回答
0

您可能想从这里开始:http: //msdn.microsoft.com/en-us/office/bb266408.aspx

有很多教程。

于 2009-08-20T02:51:46.827 回答