P
pnp
Hi
I have a problem marking a mailitem as complete, and having the 'V' icon
appear in the Outlook UI. Im coding a VSTO Addin (C#).
What i am doing is in short this:
1. When outlook receives a mail a test it for subject, and if "valid" i move
it to another folder.
2. In this folder i mark the mail with a red flag.
3. I then examine the mail, does some sql and so forth..
4. When done, i want to flag the mail complete if all went well.
1,2,3 is fixed (nr 2 after reading :
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=68162&SiteID=1). Below
is some of my sourcecode (all the relevant).
My problem is that the mail keeps the red flag icon even though it is marked
as complete. How do I get this 'completedIcon' to appear instead?
Best regards
Anders
------------ CODE EXAMPLE START ------------
//move the mail
Outlook.MailItem movedMail =
(Outlook.MailItem)newMail.Move(myOutlookFolder);
//Get the movemail again, necessary to avoid the movedMail being marked as
not sent
movedMail =
(Outlook.MailItem)GetNamespace("MAPI").GetItemFromID(movedMail.EntryID,
myOutlookFolder.StoreID);
// mark as read, red flag, and save
movedMail.UnRead = false;
movedMail.FlagStatus =
Microsoft.Office.Interop.Outlook.OlFlagStatus.olFlagMarked;
movedMail.FlagIcon =
Microsoft.Office.Interop.Outlook.OlFlagIcon.olRedFlagIcon;
movedMail.Save();
//Do my actions on the mail, sql, xml and so forth.
// ......
//When all goes good - set flagstatus as complete and save.
movedMail.FlagStatus =
Microsoft.Office.Interop.Outlook.OlFlagStatus.olFlagComplete;
movedMail.Save();
------------ CODE EXAMPLE END ------------
I have a problem marking a mailitem as complete, and having the 'V' icon
appear in the Outlook UI. Im coding a VSTO Addin (C#).
What i am doing is in short this:
1. When outlook receives a mail a test it for subject, and if "valid" i move
it to another folder.
2. In this folder i mark the mail with a red flag.
3. I then examine the mail, does some sql and so forth..
4. When done, i want to flag the mail complete if all went well.
1,2,3 is fixed (nr 2 after reading :
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=68162&SiteID=1). Below
is some of my sourcecode (all the relevant).
My problem is that the mail keeps the red flag icon even though it is marked
as complete. How do I get this 'completedIcon' to appear instead?
Best regards
Anders
------------ CODE EXAMPLE START ------------
//move the mail
Outlook.MailItem movedMail =
(Outlook.MailItem)newMail.Move(myOutlookFolder);
//Get the movemail again, necessary to avoid the movedMail being marked as
not sent
movedMail =
(Outlook.MailItem)GetNamespace("MAPI").GetItemFromID(movedMail.EntryID,
myOutlookFolder.StoreID);
// mark as read, red flag, and save
movedMail.UnRead = false;
movedMail.FlagStatus =
Microsoft.Office.Interop.Outlook.OlFlagStatus.olFlagMarked;
movedMail.FlagIcon =
Microsoft.Office.Interop.Outlook.OlFlagIcon.olRedFlagIcon;
movedMail.Save();
//Do my actions on the mail, sql, xml and so forth.
// ......
//When all goes good - set flagstatus as complete and save.
movedMail.FlagStatus =
Microsoft.Office.Interop.Outlook.OlFlagStatus.olFlagComplete;
movedMail.Save();
------------ CODE EXAMPLE END ------------