N
Neetu
We are using VSTO and C# for creation of an outlook add-in for 2003 and 2007.
Custom Folders are adding inside outlook after task folder.
each folder items are attached with two events Itemadd and Itemremove.
For 2007 events are firing properly however same code is not working for 2003.
private void AttachAddEvent()
{
try
{
if (_mfEmailReceivedList != null)
{
if (_mfEmailReceivedList.Length > 0)
{
for (int i = 0; i < _mfEmailReceivedList.Length; i++)
{
_mfEmailReceivedList.Items.ItemAdd += new
ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
}
}
}
}
catch (System.Exception ex)
{
throw ex;
}
}
mfEmailReceivedList is global object of type MAPIFolder which stores all
folders created inside outlook by our addin.
public void Items_ItemAdd(object item)
{
try
{
if (item is MailItem)
{
_objMail = new Mail(); /// our class for database
operation.
_objMail.Insert((MailItem)item);
_objMail =null;
}
}
catch (System.Exception ex)
{
ShowMessage(ex.ToString(), ex.Source);
}
}
same code we are implementing for 2003 n 2007.
in 2003 events gets fire 1 in 100 attempt. and that is also only one time
in debug or intallation mode.
Any Suggestion or help will be helpful for us to resolve our issue.
Thanks In advance
Custom Folders are adding inside outlook after task folder.
each folder items are attached with two events Itemadd and Itemremove.
For 2007 events are firing properly however same code is not working for 2003.
private void AttachAddEvent()
{
try
{
if (_mfEmailReceivedList != null)
{
if (_mfEmailReceivedList.Length > 0)
{
for (int i = 0; i < _mfEmailReceivedList.Length; i++)
{
_mfEmailReceivedList.Items.ItemAdd += new
ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
}
}
}
}
catch (System.Exception ex)
{
throw ex;
}
}
mfEmailReceivedList is global object of type MAPIFolder which stores all
folders created inside outlook by our addin.
public void Items_ItemAdd(object item)
{
try
{
if (item is MailItem)
{
_objMail = new Mail(); /// our class for database
operation.
_objMail.Insert((MailItem)item);
_objMail =null;
}
}
catch (System.Exception ex)
{
ShowMessage(ex.ToString(), ex.Source);
}
}
same code we are implementing for 2003 n 2007.
in 2003 events gets fire 1 in 100 attempt. and that is also only one time
in debug or intallation mode.
Any Suggestion or help will be helpful for us to resolve our issue.
Thanks In advance