NewInspector event doesn't fire when I use word

D

DavidE

Hi,
I have already a com addin that adds command bar buttons to a mail item
inspector.This addin is based on the NewInspector event of the inspectors
collection. When I use word and try to send this document as an attachment to
a recipient ( File ->Send to -> Mail Recipient (as attachment) ) I get a
mail item inspector with this document as an attachment but I don't have this
command bar buttons because the NewInspector doesn't fires.
What can I do to have those buttons when I open a mail item from the word ?

Thanks,
David.
 
K

Ken Slovak - [MVP - Outlook]

The modal Outlook Inspector in that case is started using Simple MAPI. No
NewInspector event is fired in that case. However, for Outlook 2002 and
later that Inspector is added to the Inspectors collection (it is not for
Outlook 2000 and earlier).

The workaround I use is to run a timer and check to see if all open
Inspectors are being handled already. Any that aren't are assumed to be
Simple MAPI Inspectors.

If you decide to handle this condition there are lots of workarounds you
will need to use. BTW, it's completely unsupported to work with such
Inspectors.

Some things you have to deal with are:

1) The Inspector is a modal one.

2) The Inspector can be opened even if Outlook was not previously running,
so you need to handle that case in your addin initialization code.

3) If Outlook was started with no UI by automation you have to handle that
case in your code.

4) If Outlook has no UI you still have to detect that it is shutting down,
if it is, after the Simple MAPI Inspector is closed or sent.

5) Possible perf issues.

6) Possible hanging of the source application that called Simple MAPI
(Excel, Word, etc.).

7) Possible hanging of Windows Explorer if the Inspector was started by a
Send To there.

There are some other issues to work through as well, but I'll leave those
for you to discover :)
 

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