Outlook adds a new copy of email to inbox

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

Guest

We have a COM Add-In for Outlook. It adds toolbars to Outlook's explorer and
inspector dialogs. When an inspector dialog is opened we add it to a
collection of inspectors in the add-in.

When the user opens a saved email item (XXX.MSG) by double-clicking it on,
say, the desktop, Outlook adds a new instance of that email item to the
user's inbox. Repeatedly opening the saved item adds a new instance each
time. There is no code in the add-in to add the item to the inbox.

The add-in has a NewInspector event handler and an Inspector_Activate event
handler. But is is AFTER the latter that Outlook adds a new email instance
into the Inbox. We know that Excel changes how it handles some events when
the developer handles the same events, does Outlook do the same?

Does anyone know how we can prevent these additional instances?

Thanks...
 
I tried what you said and 'disabled' the code in both event handlers. As I
reinstated lines of code, this one triggered the extra instance:-
Debug.Print (objItem.FormDescription.UseWordMail = True)
where objItem is an Object assigned to the Inspector.CurrentItem.
Because of the toolbar interaction we use, we don't support the Word Editor
in Outlook. Previously we checked:
(objInsp.IsWordMail = True)
(objInsp.EditorType = olEditorWord)
to test for the Word Editor. But I think I added the other one for 2007
which we have not validated yet anyway.
We may not have to worry about 2007 as I believe Word is not called any more
to provide the Word Editor functionality.

Thank you for suggesting checking our event code. I wonder why accessing
that property saves a new instance?

Jef
 
Now I remember why we added that test of
objItem.FormDescription.UseWordMail = True
It was to allow 2007 to pass the test. We will have to check the Outlook
version and rely on that rather than testing the offending property.

Jef.
 
Back
Top