VSTO AddIn for Word Only

I wrote a VSTO addin for Word 2003 that works correctly. The only problem is that the addin displays the control panel which also appears when creating a new email in Outlook. How can I prevent the admin panel from showing in the Outlook context and only in Word?

+1


source to share


4 answers


Your problem is that Outlook is using Word as the editor for your email messages.



You can turn this off from the Mail Options in Outlook, or you may need to perform detection, for example, the Document.Kind property will be wdDocumentEmail (= 2) if it is an email

+2


source


I haven't tried this, but can you use the Parent property of a Word instance to determine if it's the parent of Outlook, in which case the command doesn't appear?



+1


source


The parent property just reverts to Microsoft Word and never Outlook. I ended up importing User32.dll and getting the Windows name and then checking if it contained Microsoft Word.

The only problem I'm still running into is that if a user opens Outlook, creates a new message, and then opens Word, the WINWORD.exe process still has what I assumed is the default template. and so the new copy word won't show my plugin.

0


source


Word has several properties that will allow you to determine whether it is running as a mail editor or not.

App.MailEnvelope App.Envelope App.Email

All information related to return email. I believe that at least one of these will return ANYTHING if the word is NOT used as an email editor, but I no longer have access to that code, so I couldn't be sure without trying to execute it.

However, I know that even MS recommends against using Word as your email editor. in Office 2007 and 2010, I no longer believe that even an option.

0


source







All Articles