I have a Word COM Addin that I want to disable when running under
Outlook (Word being the email editor). Is there a property that I can use to
determine if Word launched the addin, or Outlook.
Thanks for the help
Regards,
Andrew
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Andrew M" <andre...@hotmail.com> wrote in message
news:118sla6...@corp.supernews.com...
Thank you for your response. Unfortuately, The Application object Passed
looks quite like the Word Application object. That is to say, I see no
discernable difference between the two. Could you point out a specific
property or parameter that would help me make this discernment?
Thanks,
Andrew
"Ken Slovak - [MVP - Outlook]" <kens...@mvps.org> wrote in message
news:%23V$455uXF...@TK2MSFTNGP12.phx.gbl...
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Andrew M" <andre...@hotmail.com> wrote in message
news:11972tr...@corp.supernews.com...
I share the same problem - and it is saying "Microsoft Word" NOT "Microsoft
Outlook". So, the question is still pending (How to determine if Word was
starting in the context of Outlook or on its own - and then preventing the
Word-AddIn from being executed if Outlook was loaded)
If you handle the Document_Activate event in Word you get a procedure that
looks something like this:
Private Sub oWord_WindowActivate(ByVal Doc As Word.Document, ByVal Wn As
Word.Window)
You can test in that event handler for Wn.EnvelopeVisible, which will tell
you if the document was opened as a WordMail document. From that you can
decide to disable the Word addin or if the code is in Word you can just
bypass the initializations for the addin.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"tingletanglebob" <tinglet...@discussions.microsoft.com> wrote in
message news:FC449712-7467-44E3...@microsoft.com...
The following works for me:
public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode,
object addInInst, ref System.Array custom)
{
// Do not run if application is embedded
if ((int) custom.GetValue(1) != 1)
return;
// ...
}
Best wishes,
Alex.
--
Address email to user "response" at domain "alexoren" with suffix "com"
your solution is working fine - and I am stopping to get grey hairs :-)
"Ken Slovak - [MVP - Outlook]" wrote: