CoCreateInstance和Word.Document [英] CoCreateInstance and Word.Document

查看:126
本文介绍了CoCreateInstance和Word.Document的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何调用CoCreateInstance传递Word.Document的GUID并让返回的 对象与
new相关联 Winword.exe的价格?


我基本上是在尝试编写将word文档的客户端站点设置为我的OLE容器的代码。 这在使用CoCreateInstance时工作正常,但在我自动执行单词应用程序并通过自动化手动打开我的文档时不起作用。


我想这与自动化的事实有关, Word文档立即与外部客户端网站相关联。 但是使用CoCreateInstance,单词文档不会立即关联,因此SetClientSite
似乎有效。


但是在一天结束时,我希望我的Word文档与之关联Word应用程序的新实例。

解决方案

Hi Jones,


我正在移动此帖子“ Visual C ++ General" 论坛到&ndquo; Word for
开发人员”论坛,因为这个问题与MS Word有关。 "Word for
开发人员""更多 专家论坛。


 


问候,

Yi Feng Li

< a href ="http://msdn2.microsoft.com/en-us/subscriptions/aa974230.aspx"> 论坛中的MSDN订阅者支持

如果您对我们的支持有任何反馈,请联系
msdnmg @ microsoft .COM


Does anyone know of a way to call CoCreateInstance passing in the GUID for a Word.Document and having the returned object associated with a new istance of Winword.exe?

I am basically trying to write code that Sets the Client site of the word document to my OLE container.  This works fine when using CoCreateInstance, but does not work when I Automate the word application and manually open my document via automation.

I suppose this has something to do with the fact that with Automation, the Word document becomes associated with an external client site right away.  But with CoCreateInstance, the word document does not get associated right away and thus SetClientSite seems to work.

But at the end of the day, I want my Word Document associated with a new instance of a Word Application.

解决方案

Hi Jones,

I am moving this thread from “Visual C++ General" forum to the “Word for Developers” forum, since the issue is related to MS Word. There are more experts in the “Word for Developers " forum.

 

Regards,
Yi Feng Li
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com.


这篇关于CoCreateInstance和Word.Document的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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