Supporting Word as E-mail Editor

  • Thread starter Thread starter Sanjay Singh
  • Start date Start date
S

Sanjay Singh

I have developed an addin that works perfectly when Outlook is used as the
e-mail editor (thank you to everyone who in this newgroup who has helped me
with this project).

I would like to now make the addin work also if Word is being used as the
e-mail editor. I would like to support Outlook 2000 onwards (if possible)
.... otherwise Outlook 2002/2003 is fine.

Are there any code samples that show how we can add buttons to inspectors
(and code to make the buttons do something) when Word is being used as the
mail editor.
Is it possible to have the code in such a way that the addin works out if
Word is the editor (or not) and then does the appropriate things.

I have bought almost all the books on Outlook development and this is a
topic that seems to be ignored.

Thank you for your help.
Regards
Sanjay
 
No NewInspector event for Outlook 2000 when Word is the email editor, so
forget that.

In Outlook 2002 and up you do get NewInspector. In that event handler check
for Word as the editor. You can get "Standard" from Word but not "Menu Bar".
You just get a Word Application object and Standard and add the button as
you would for an Outlook Inspector button.

If the user gets prompts for saving Normal.dot changes they will be prompted
when Word shuts down unless you use
Document.AttachedTemplates.Item("Normal").Saved = True when the email in the
Inspector is closed or the Inspector is closed. That tells Word the template
is saved and the user won't get prompted.
 
Ken

As always, thank you for your help.
Is there any sample code to show this being done.

In particular how will the code for both Word editor and Outlook editor
reside in the same addin so that I do not need to have two seperate programs
to maintain.

Thanks again
Sanjay
 
Offhand I don't know of any sample code out there for this.

I use code in my Inspector wrapper class module that gets the current editor
using Inspector.IsWordMail. If it's True I then use Inspector.WordEditor to
get a handle to the Word Document object. Then I create the button in Word.
The click event handler for the button is still located in the same
Inspector class module, in fact it's the same as if it were the Outlook
editor.

The only things to watch out for are maintaining a separate variable to
store the button's State property, reading it in the Click event seems to be
iffy, and that WordEditor is restricted in Outlook 2003 and Outlook 2002
SP3. For that problem I use Redemption to get Inspector.WordEditor.
 
Back
Top