Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Word COM Addin running under Outlook - Help!

5 views
Skip to first unread message

Andrew M

unread,
May 20, 2005, 5:21:23 PM5/20/05
to
Hello

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]

unread,
May 22, 2005, 12:41:49 PM5/22/05
to
On_Connection. The Application object passed in that event would tell you
that.

--
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...

Andrew M

unread,
May 24, 2005, 4:14:56 PM5/24/05
to
Ken

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]

unread,
May 25, 2005, 9:03:12 AM5/25/05
to
Use Application.Name. It will contain the string "Word" or "Excel" or
"PowerPoint" or whatever.

--
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...

tingletanglebob

unread,
Jul 25, 2005, 10:21:02 AM7/25/05
to
Hi Ken,

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)

Ken Slovak - [MVP - Outlook]

unread,
Jul 26, 2005, 9:36:07 AM7/26/05
to
Note that I said "contain" the string "Word", you can test for that or test
for the full string of "Microsoft Word".

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...

Alex

unread,
Jul 26, 2005, 6:51:52 PM7/26/05
to

"tingletanglebob" <tinglet...@discussions.microsoft.com> wrote in message news:FC449712-7467-44E3...@microsoft.com...
> Hi Ken,
>
> 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)

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"

tingletanglebob

unread,
Jul 27, 2005, 4:39:03 AM7/27/05
to
Thanks Ken,

your solution is working fine - and I am stopping to get grey hairs :-)

"Ken Slovak - [MVP - Outlook]" wrote:

0 new messages