AutomationFactory - 所需信息
我对使用 AutomationFactory 命名空间很感兴趣,但我找不到任何有关可用于特定 COM 的文档。我想这是因为我不知道我实际上应该查找哪些术语。有人有资源吗?我特别寻找有关 Excel、Word 和 Outlook 的信息。
提前致谢!
I am interested in using the AutomationFactory namespace but I cannot find any documentation on what I can use for a sepcific COM. I figure it's because I do not know what terms I should actually be looking up. Does anyone have any resources? In particular I'm looking for information on Excel, Word and Outlook.
Thanks In Advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
AutomationFactory 是一个类,而不是一个命名空间。它特定于 Silverlight 版本 4,这是一种默认情况下不支持 COM 自动化的执行环境,仅当应用程序作为受信任的应用程序在浏览器外运行时才支持。 MSDN 库文章 是此处,页面底部有一个指向“操作方法”页面的链接。
AutomationFactory is a class, not a namespace. It is specific to Silverlight version 4, an execution environment that doesn't support COM Automation by default, only if the app runs out-of-browser as a trusted app. The MSDN Library article is here, the bottom of the page has a link to a How-To page.
您应该从此处的 MSDN 主题开始: Office 开发
然后我倾向于创建一个实验性的 Windows 控制台应用程序并引用相关的 Office COM 库。借助智能感知编写代码来操作 Office COM 对象,了解应用程序真正需要做什么。
编写一大堆类和方法,从 Office 对象操作的实际机制中抽象出您最终想要在 Silverlight 中执行的操作。
使用
dynamic
类型将代码移植到 Silverlight,您会丢失 Office 的 COM 对象上的所有智能感知,但到了这个阶段,您已经创建了一堆类,一旦移植,这些类就是您真正的 Silverlight 代码将用于进行办公室操作。You should start with the MSDN topic here: Office Development
I would then be inclined to create an experimental Windows Console application and reference the relevant office COM libraries. Write code to manipulate the office COM objects with the benefit of intellisense, get some sembalence of the what the app really needs to do working.
Write a whole bunch of classes and methods which abstract the manipulations you ultimately want to perform in Silverlight from the actual mechanics of office object operations.
The port the code to Silverlight using the
dynamic
type, you lose all the intellisense on the COM objects of office but by this stage you've created a bunch of classes which once ported are what your real Silverlight code will use to do office operations.COM 信息与您在 VBA 中找到的信息相同,因此当我进行互联网搜索时,我只是查找与之相关的信息。
The COM information is the same as what you would find in VBA so when I do internet searches i just look for information related to that.