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.
精彩评论