Set Email Flag Status in Outlook 2007
Is there a way in Outlook 2007 to set a follow-up flag on an email object? It looks like it was supported in Outlook 2开发者_如何学编程003 with .FlagStatus property, but I can't find it in 2007.
From the outlook change notes:
For Follow Up Flags For Follow Up Flags, introduced in Microsoft Office Outlook 2003, are replaced by task flags and color categories. You no longer see colored flags in the Mail view. If you flagged items in the earlier version of Outlook to indicate that they were important or that they belonged to a particular group, you should now use color categories instead. If you used flags to indicate the time at which you were to take action on an item, you should now use task flags. This change is being made to increase the functionality of flags. With task flagging, you can place an item in the overall task management system, allowing you to see your tasks in the To-Do Bar, Daily Task List in Calendar, and in the Tasks view. By categorizing an item, you can easily scan your Inbox for categorized items, the same way that you might previously have scanned your Inbox for flagged items. You can also find categorized items in the Categorized Mail Search Folders.
So the concept of the flag changed, which is why the FlagStatus property has changed. According to this, the following should work:
Set SelectedItems = Outlook.ActiveExplorer.Selection
For Each Item In SelectedItems
With Item
.ToDoTaskOrdinal = dtTaskDate
.TaskDueDate = dtTaskDate
.TaskStartDate = dtTaskDate
.FlagStatus = 2
.FlagRequest = strFlagRequest
.Categories = strCategories
.FlagIcon = 6
.Save
End With
Next Item
This is what http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._mailitem.flagstatus.aspx has to say:
Dim instance As _MailItem
Dim value As OlFlagStatus
value = instance.FlagStatus
instance.FlagStatus = value
精彩评论