A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook: Mark a mailitem as complete



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old July 4th 06, 06:35 AM posted to microsoft.public.outlook.program_vba
pnp
external usenet poster
 
Posts: 8
Default Outlook: Mark a mailitem as complete

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 ------------



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mark appointment complete in outlook? don Outlook - Calandaring 2 June 20th 06 12:22 PM
How do I mark task complete when not the owner? CLSH Outlook - Installation 0 May 19th 06 06:05 PM
add a feature to outlook calendar to mark of days as they pass. OUTLOOK FEATURE SUGGESTION Outlook - Calandaring 1 May 19th 06 03:18 AM
Creating an Outlook MailItem when Outlook hasn't been opened WhytheQ Outlook and VBA 1 May 10th 06 11:41 PM
How can I create a MailItem that displays like a received MailItem ? Clive Outlook - Using Forms 0 February 27th 06 04:14 PM


All times are GMT +1. The time now is 04:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.