Word Add-In does conflict with Outlook when Word is the e-Mail Edi

R

Radrizzi Gilles

Hi,
We developed an .NET AddIn for Word, Excel, Powerpoint. The Add-In works
fine for all the application. However, we encountered a problem when Outlook
is opened.
Indeed Outlook uses Word as our e-Mail Editor. So here's the situation:
When Outlook loads, it also directly loads Word. The Add-In gets loaded into
this instance of Word. Indeed, when I Create a new e-Mail Message, the
Add-In gets displayed into the "New Message" form. Now when I open Word
itself, the Add-In is not loaded.

On the other hand, when Outlook is closed and then I open Word, the Add-In
gets loaded correctly. In this situation, once word is loaded and I load
Outlook, the Add-In will NOT get loaded in the instance of Winword opened by
outlook.

I conclude that the Add-In is only loaded in the first instance of Winword
which is started. Every following instance will not load the Add-In.

Has anyone encountered this behavior or found a solution to it. I need the
add-in to only load in Word. It is not necessars to load with the Winword
instance opened by outlook. Also, I need it to start at startup op the
application.

Any hints regarding this would be welcome
 
K

Ken Slovak - [MVP - Outlook]

Since only the first instance of Word being called fires the On_Connection
event for your addin you should simply monitor when any new Word window or
document is opened. You can then check for Window.EnvelopeVisible = True. If
to it's a WordMail document and you don't add your buttons or whatever. If
not true then it's a true Word doc and you can do what you need to do in
that case.
 
R

Radrizzi Gilles

Thanks for your answer.
It was exactly what I was looking for. The EnvelopeVisible property works
just fine.

I just had some trouble Attaching to the NewDocument Event from Word. Indeed
as some users in our company still use Office 10 whereas others use Office
11 I did not want to add a reference to the Word11 COM DLL.
I am now using reflection to identify the correct Event during runtime and
attach to it. Was not easy as I've never done this before but it finally
works after almost 2 days.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top