ItemEvents_10_OpenEventHandler does not respond on DocumentItems

M

mightyCoCo

Hi,

I'm using the ItemEvents_10_OpenEventHandler to catch a open (double-
click) event on a Outlook item.
This works great on MailItem or PostItem types. However, Outlook
objects of the type DocumentItem dosen't seem to fire this event.
Instead I'm directly presented wih the document in it's native
application.

Is this a known restriction?
(Outlook 2007, VS2005)

thanks in advance,
-coco
 
K

Ken Slovak - [MVP - Outlook]

According to the documentation the Open() event will fire if the
DocumentItem is opened in an Inspector. If it's not opened in an Inspector
but only in it's native application I wouldn't expect that event to work.

Check the count of the Inspectors collection before and after opening one of
these items and see if a new Inspector has been added to the collection. If
it has a workaround might be to handle NewInspector() and then check for
Inspector.CurrentItem.Class in that event handler. DocumentItem supports the
Class property and if the return from that is OlObjectClass.olDocument (41)
then you know a DocumentItem is being opened.
 
M

mightyCoCo

According to the documentation the Open() event will fire if the
DocumentItem is opened in an Inspector. If it's not opened in an Inspector
but only in it's native application I wouldn't expect that event to work.

Check the count of the Inspectors collection before and after opening oneof
these items and see if a new Inspector has been added to the collection. If
it has a workaround might be to handle NewInspector() and then check for
Inspector.CurrentItem.Class in that event handler. DocumentItem supports the
Class property and if the return from that is OlObjectClass.olDocument (41)
then you know a DocumentItem is being opened.

Hi Ken,

I tried using the NewInspector event handler. It's not fired either,
as Outlook doesn't seem to open an Insspector at all for a
DocumentItem.

Let's say the DocumentItem object in my Inbox is a .html object. If i
select it, in the preview pane the html file is rendered. If i double
click the object, Internet Explorer opens. The double click doesn't
open a new Inspector or triggers the Open event. It seems that Outlook
is directly running the process which is assigned to the object class
(Word for .doc, IE for .html, Notepad for .txt, etc...)

I wonder if I need to set the MessageClass of the object to something
else than IPM.Document, to trigger the event... But i guess, I'd loose
the document-specific icon in the Outlook list view then...

thanks,
-coco
 

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