Supporting Word as E-mail Editor

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
 
K

Ken Slovak - [MVP - Outlook]

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

Sanjay Singh

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

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