开发者

Capturing Word application using COM

开发者 https://www.devze.com 2022-12-22 11:38 出处:网络
I am trying to ca开发者_开发技巧pture the name and path for an active Word application using COM components But whenever a dialog box (like save as.. or print etc.) is open, I get a COMException - \"T

I am trying to ca开发者_开发技巧pture the name and path for an active Word application using COM components But whenever a dialog box (like save as.. or print etc.) is open, I get a COMException - "The message filter indicated that the application is busy". Is there a way around it for fetching the document details?

Thanks


What you likely want to do is write an addin for word (Iether VSTO, or by implementing IExtensibility2). Word will signal the addin of all sorts of events (like opening/saving files, etc), and then the addin would signal whatever external app you need to signal, in whatever way you might want for it to signal (Com, DDE, Named pipes, polling, etc). A caution about DisplayAlerts. It doesn't supress ALL alerts, so if you're addin manipulates and controls word, you just have to not do things that can result in a dialog.

0

精彩评论

暂无评论...
验证码 换一张
取 消