How to determine if Word is opened as standalone or as part of Outlook

N

NanoWizard

Does anyone know what to look for in determining if you are opening
Word as a standalone app by double clicking winword.exe or through
it's use in Outlook? I have an addin that I only want to work when
used by Word itself not when Word is embedded in another application.

Thanks in advanced.
 
N

NanoWizard

Figured it out.
The custom System.Array parameter from the IDTExtensibility2 interface
will tell you how it was started:

public void OnConnection(object application,
Extensibility.ext_ConnectMode connectMode, object addInInst, ref
System.Array custom)

An array of Variant type values that provides additional data. The
numeric
value of the first element in this array indicates how the host
application
was started:
from the user interface (1),
by embedding a document created in the host application in another
application (2),
or through Automation (3).

http://msdn.microsoft.com/library/d...rkingwithidtextensibility2eventprocedures.asp
 

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