Outlook Inbox open item event

Z

Zoran Kumurdian

Hi

I am reasonably comfortable with CDO, using it with VB6 for about 6
months. I wonder if it is possible to trap the event when a user double
clicks on a new mail message in their Outlook Inbox. I am aware of the
possibility of launching a custom form (VB Script in the form) but that
has serious limitations.

The idea is to trap the event and if the message type is predefined i.e.
IPM.Note.Special, we launch a pure VB form INSTEAD of the Outlook
message form (custom or standard).

I have seen applications that do this and I am convinced it is
possibble, but haven't been able to find the appropriate event.

Any ideas would be most welcome.

Thank you in advance

Zoran



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Z

Zoran Kumurdian

Hi Sue,

I admire the amount of time and effort you put into this. Thank you for
the response and it is a COM AddIn we already have. I'd like to add the
Inspectros.NewInspector event but I am a bit lost as to where to start
:S We have used the MicroEye sample as a starting point and it has
worked well. eg

Set objNS = objOutlook.GetNamespace("MAPI") 'NameSpace Object

Set colExpl = objOutlook.Explorers 'Explorers Object
Set colInsp = objOutlook.Inspectors 'Inspectors Object
Set objExpl = objOutlook.ActiveExplorer 'Explorer Object

Can you please provide some sample code. If you need more information,
please let me know.

Regards

Zoran




Re: Outlook Inbox open item event
From: Sue Mosher [MVP]
Date Posted: 9/10/2003 6:40:00 AM

I presume you're thinking of building this as a COM addin? Take a look
at the Inspectors.NewInspector event. This passes the opened item as an
argument, so you can check the MessageClass property and proceed
accordingly.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



Zoran Kumurdian said:
Hi

I am reasonably comfortable with CDO, using it with VB6 for about 6
months. I wonder if it is possible to trap the event when a user double
clicks on a new mail message in their Outlook Inbox. I am aware of the
possibility of launching a custom form (VB Script in the form) but that
has serious limitations.

The idea is to trap the event and if the message type is predefined i.e.
IPM.Note.Special, we launch a pure VB form INSTEAD of the Outlook
message form (custom or standard).

I have seen applications that do this and I am convinced it is
possibble, but haven't been able to find the appropriate event.

Any ideas would be most welcome.

Thank you in advance

Zoran


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Sue Mosher [MVP]

You need to Dim colInsp WithEvents as a module-level variable. Once you do that, you'll can use the NewInspector event, something like this:

Dim WithEvents colInspectors As Outlook.Inspectors

Sub initproc()
' runs when addin initializes
Set colInsp = objOutlook.Inspectors 'Inspectors Object
End Sub

Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)
Dim objItem as object
set objItem = Inspector.CurrentItem
If objItem.MessageClass = "IPM.Note.Special" Then
Call LaunchOurVBForm
Inspector.Close olDiscard
End If
End Sub
 
Z

Zoran Kumurdian

Hi Sue,

Yes that worked great, thank you. However, after the custom (VB) form
is shown, it also shows the standard message form, which defeats the
purpose of the custom form.

It seems we need to add code to "bypass" displaying the standard mail
item form.

Please advise, I am sure you have the answer.

Regards

Zoran


You need to Dim colInsp WithEvents as a module-level variable. Once you
do that, you'll can use the NewInspector event, something like this:

Dim WithEvents colInspectors As Outlook.Inspectors

Sub initproc()
' runs when addin initializes
Set colInsp = objOutlook.Inspectors 'Inspectors Object
End Sub

Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)
Dim objItem as object
set objItem = Inspector.CurrentItem
If objItem.MessageClass = "IPM.Note.Special" Then
Call LaunchOurVBForm
Inspector.Close olDiscard
End If
End Sub

Zoran Kumurdian said:
Hi Sue,

I admire the amount of time and effort you put into this. Thank you for
the response and it is a COM AddIn we already have. I'd like to add the
Inspectros.NewInspector event but I am a bit lost as to where to start
:S We have used the MicroEye sample as a starting point and it has
worked well. eg

Set objNS = objOutlook.GetNamespace("MAPI") 'NameSpace Object

Set colExpl = objOutlook.Explorers 'Explorers Object
Set colInsp = objOutlook.Inspectors 'Inspectors Object
Set objExpl = objOutlook.ActiveExplorer 'Explorer Object

Can you please provide some sample code. If you need more information,
please let me know.

Regards

Zoran




Re: Outlook Inbox open item event
From: Sue Mosher [MVP]
Date Posted: 9/10/2003 6:40:00 AM

I presume you're thinking of building this as a COM addin? Take a look
at the Inspectors.NewInspector event. This passes the opened item as an
argument, so you can check the MessageClass property and proceed
accordingly.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Sue Mosher [MVP]

Did you try putting the Inspector.Close statement before you launch your form?
 
Z

Zoran Kumurdian

Hi Sue,

I tried that as well but same result i.e. my form gets launched AFTER
standard form. Any other ideas? I see from others in this forum the
problem is not uncommon but there are no solutions offered.

Regards

Zoran



Did you try putting the Inspector.Close statement before you launch your
form?

Zoran Kumurdian said:
Hi Sue,

Yes that worked great, thank you. However, after the custom (VB) form
is shown, it also shows the standard message form, which defeats the
purpose of the custom form.

It seems we need to add code to "bypass" displaying the standard mail
item form.

Please advise, I am sure you have the answer.

Regards

Zoran


You need to Dim colInsp WithEvents as a module-level variable. Once you
do that, you'll can use the NewInspector event, something like this:

Dim WithEvents colInspectors As Outlook.Inspectors

Sub initproc()
' runs when addin initializes
Set colInsp = objOutlook.Inspectors 'Inspectors Object
End Sub

Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)
Dim objItem as object
set objItem = Inspector.CurrentItem
If objItem.MessageClass = "IPM.Note.Special" Then
Call LaunchOurVBForm
Inspector.Close olDiscard
End If
End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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