View Single Post
  #3  
Old July 6th 06, 07:19 AM posted to microsoft.public.outlook.program_vba
pnp
external usenet poster
 
Posts: 8
Default Outlook: Mark a mailitem as complete

I've done that. But that just makes the flag disappear. (as the name kind of
says)

And appearently you can't mark a mail item complete without a flag.

At least thats my experience...

/Anders

"Ken Slovak - [MVP - Outlook]" wrote:

Try setting FlagIcon = olNoFlagIcon

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"pnp" wrote in message
...
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/Sho...8162&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").GetItemFrom ID(movedMail.EntryID,
myOutlookFolder.StoreID);

// mark as read, red flag, and save
movedMail.UnRead = false;
movedMail.FlagStatus =
Microsoft.Office.Interop.Outlook.OlFlagStatus.olFl agMarked;
movedMail.FlagIcon =
Microsoft.Office.Interop.Outlook.OlFlagIcon.olRedF lagIcon;
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.olFl agComplete;
movedMail.Save();

------------ CODE EXAMPLE END ------------





Ads