T
Tim van Rooijen
Hello,
I'm developing an outlook add in with visual studio 2008 .net 3.5
The program allows user to save email in a cms from the email inspector window.
The add-in works correctly when outlook is started normally .
But when outlook is not yet started and you open a msg file it won’t work correctly. An inspector window opens (really slow ) and I’m not able to catch the current mailitem.
How can you catch the current mailitem when the inspector window is opened directly ?
PS.
Sorry for my poor English I’m dutch
private Outlook.Inspectors Inspectors;
internal static Outlook.MailItem Item;
private Outlook.Inspectors Inspectors;
internal static Outlook.MailItem Item;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Inspectors = Application.Inspectors;
// Extra event handler voor het new inspector event
Inspectors.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(
inspectors_NewInspector);
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
Inspectors.NewInspector -= new Outlook.InspectorsEvents_NewInspectorEventHandler(inspectors _NewInspector);
Inspectors = null;
Item = null;
}
void inspectors_NewInspector(Outlook.Inspector Inspector)
{
if (Inspector.CurrentItem is Outlook.MailItem)
{
Item = (Outlook.MailItem)Inspector.CurrentItem;
}
}
I'm developing an outlook add in with visual studio 2008 .net 3.5
The program allows user to save email in a cms from the email inspector window.
The add-in works correctly when outlook is started normally .
But when outlook is not yet started and you open a msg file it won’t work correctly. An inspector window opens (really slow ) and I’m not able to catch the current mailitem.
How can you catch the current mailitem when the inspector window is opened directly ?
PS.
Sorry for my poor English I’m dutch
private Outlook.Inspectors Inspectors;
internal static Outlook.MailItem Item;
private Outlook.Inspectors Inspectors;
internal static Outlook.MailItem Item;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Inspectors = Application.Inspectors;
// Extra event handler voor het new inspector event
Inspectors.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(
inspectors_NewInspector);
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
Inspectors.NewInspector -= new Outlook.InspectorsEvents_NewInspectorEventHandler(inspectors _NewInspector);
Inspectors = null;
Item = null;
}
void inspectors_NewInspector(Outlook.Inspector Inspector)
{
if (Inspector.CurrentItem is Outlook.MailItem)
{
Item = (Outlook.MailItem)Inspector.CurrentItem;
}
}