R
Rolando Tonin
I’m Rolando Tonin, an italian engineer , and I’m developing an Outlook2007
AddIn in C# with Visual Studio 2008 and VSTO 3.0.
My AddIn contain a FormRegion linked to a specific MessageClass (i.e.:
IPM.Note.IdroesseTaskFaseBO). This FormRegion must display specific business
information when the user open an e-mail incoming from a SQL Server trigger.
This e-mail has a distinct Subject. When SQL Server trigger the e-mail I
can’t associate MessageClass (I use SPROC sp_send_dbmail that, unfortunately,
hasn’t a @parameter of this type). Conseguently I must associate the
MessageClass when the e-mail get in Outlook. For this I use NewMailEx event.
When this event is triggered I process the MailItem’s Subject and if it is
equal to my Subject I change the MessageClass property of the MailItem object
and save this. When the user open the InBox Message the Form Region appare
correctly.
This work fine if Outlook is open when the SQL Server trigger the e-mail.
Instead, if Outlook is closed, the e-mail, logically, is storaged on the
Exchange Server. When the user open Outlook the e-mail is downloaded from
Exchange Server but the NewMailEx is not called. Conseguenty when the user
open the e-mail this is displayed on the standard e-mail form….
I tried with Outlook Application ItemLoad event. I intercept the MailItem
change the MessageClass, save the MailItem but the e-mail is displayed on the
standard e-mail form. If the user close this form and reopen the e-mail this
time the FormRegion appare correctly. I don’t like to force the user to open
two times the e-mail before to get the correct FormRegion.
How can I resolve this problem?
Thanks in advance
AddIn in C# with Visual Studio 2008 and VSTO 3.0.
My AddIn contain a FormRegion linked to a specific MessageClass (i.e.:
IPM.Note.IdroesseTaskFaseBO). This FormRegion must display specific business
information when the user open an e-mail incoming from a SQL Server trigger.
This e-mail has a distinct Subject. When SQL Server trigger the e-mail I
can’t associate MessageClass (I use SPROC sp_send_dbmail that, unfortunately,
hasn’t a @parameter of this type). Conseguently I must associate the
MessageClass when the e-mail get in Outlook. For this I use NewMailEx event.
When this event is triggered I process the MailItem’s Subject and if it is
equal to my Subject I change the MessageClass property of the MailItem object
and save this. When the user open the InBox Message the Form Region appare
correctly.
This work fine if Outlook is open when the SQL Server trigger the e-mail.
Instead, if Outlook is closed, the e-mail, logically, is storaged on the
Exchange Server. When the user open Outlook the e-mail is downloaded from
Exchange Server but the NewMailEx is not called. Conseguenty when the user
open the e-mail this is displayed on the standard e-mail form….
I tried with Outlook Application ItemLoad event. I intercept the MailItem
change the MessageClass, save the MailItem but the e-mail is displayed on the
standard e-mail form. If the user close this form and reopen the e-mail this
time the FormRegion appare correctly. I don’t like to force the user to open
two times the e-mail before to get the correct FormRegion.
How can I resolve this problem?
Thanks in advance