How to tell if Word is the email editor?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way I can tell if Word is the email editor being used for a new email or if it's something else? I catch the open event (NewInspector) and then need to know if this is a Word editor or something else. Any way to do this
Thanks.
 
I should clarify this a bit...I get an error when using the code below, so I am looking for another solution

if mailItem.GetInspector.EditorType.Equals(olEditorType.olEditorWord) the
.....

The error I get is 'The operation failed.

Thanks

----- Bart F. wrote: ----

Is there a way I can tell if Word is the email editor being used for a new email or if it's something else? I catch the open event (NewInspector) and then need to know if this is a Word editor or something else. Any way to do this
Thanks.
 
Hi,

I'm going to quote from Outlook VBA Help:

"
IsWordMail Method


Determines whether the mail message associated with an
inspector is displayed in an Outlook Inspector or in
Microsoft Word. Returns True if the mail message is
displayed in Microsoft Word (that is, if Word Mail is in
use). The OlEditorType constant will be olEditorWord(4).

Syntax

objInspector.IsWordMail

objInspector Required. An expression that returns an
Inspector object.
"

You will get much farther in Outlook programming if you
learn to use the VBA Help - F1 when in the VBA Editor- and
the Object Browser - F2 when in the Editor.

You could have found this answer simply by opening the
Object Browser and searching for "Word".

Good Luck,

-Andrew
====================================
-----Original Message-----
Is there a way I can tell if Word is the email editor
being used for a new email or if it's something else? I
catch the open event (NewInspector) and then need to know
if this is a Word editor or something else. Any way to do
this?
 
Bart-

Try:

If Not Inspector.IsWordMail Then ...

That tells you it's not a Word window.

You don't need that mailItem.GetInspector code in this
case, because the NewInspector event receives the current
Inspector as a parameter, stored in the "Inspector"
variable- this will become clear if you look at the
beginning of the event handler.


-Andrew
========================================
-----Original Message-----

I should clarify this a bit...I get an error when
using the code below, so I am looking for another solution:
if mailItem.GetInspector.EditorType.Equals
(olEditorType.olEditorWord) then
......

The error I get is 'The operation failed.'

Thanks.


----- Bart F. wrote: -----

Is there a way I can tell if Word is the email
editor being used for a new email or if it's something
else? I catch the open event (NewInspector) and then need
to know if this is a Word editor or something else. Any
way to do this?
 
Back
Top