Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Addin to trap email item open (http://www.outlookbanter.com/outlook-vba/92198-addin-trap-email-item-open.html)

John[_11_] July 2nd 09 07:40 PM

Addin to trap email item open
 
Hi

I am trying to write an add-in in vs2008 for OL2003. Is there a way to trap
the item open event i.e. when a mail item is opened by user? This is to give
user choice of either opening the mail item as normal or allow the add-in to
do something else to the email?

Thanks

Regards



Ashutosh Jogdande July 3rd 09 08:49 AM

Addin to trap email item open
 
Hi John,

You can achieve this by handling Application.ItemLoad event,
in this you can look for MailItem as an Objet type, if it is then handle
MailItem's Open event.

Thanks,
Ashutosh

"John" wrote in message
...
Hi

I am trying to write an add-in in vs2008 for OL2003. Is there a way to
trap the item open event i.e. when a mail item is opened by user? This is
to give user choice of either opening the mail item as normal or allow the
add-in to do something else to the email?

Thanks

Regards




Dmitry Streblechenko July 3rd 09 08:54 AM

Addin to trap email item open
 
Look at the Application.Inspectors.NewInspector event. It will not let you
cancel the action.
You can also trap the MailItem.Open event (which is canceable), but that
means that you will need to set an an event handler on each selected
messages and track the selection by using the Explorer.SelectionChange
event.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"John" wrote in message
...
Hi

I am trying to write an add-in in vs2008 for OL2003. Is there a way to
trap the item open event i.e. when a mail item is opened by user? This is
to give user choice of either opening the mail item as normal or allow the
add-in to do something else to the email?

Thanks

Regards





All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com