共用方式為


Categorize Your Outlook Items

Microsoft Outlook provides color categorization functionality, in which Outlook items can be categorized and displayed by category. Multiple color categories can be applied to a single Outlook item, and Outlook items can be grouped or sorted by color category. Shortcut keys can be assigned to each color category, to allow users to more easily categorize items. Color categories are user-defined, and can be created, deleted, and changed either programmatically or by user action within the Outlook user interface.

The Category object represents a single user-defined color category in the Master Category List, the list of color categories presented in the Outlook user interface and represented by the Categories collection of the NameSpace object. Category objects are identified with a globally unique identifier (GUID) when created, and this identifier cannot be changed. However, the name, color, and shortcut key associated with a color category can be changed by setting the Name, Color, and ShortcutKey properties, respectively, of the Category object. The CategoryID property can be used to retrieve the identifier of a Category object.

Assigning Categories to Outlook Items

Categories can be assigned to Outlook items by specifying the names of the appropriate Category objects in a comma-delimited string in the Categories property of the following objects:

AppointmentItem

RemoteItem

ContactItem

ReportItem

DistListItem

SharingItem

DocumentItem

PostItem

JournalItem

TaskItem

MailItem

TaskRequestAcceptItem

MeetingItem

TaskRequestDeclineItem

MobileItem

TaskRequestItem

NoteItem

TaskRequestUpdateItem

Outlook items are displayed based on the category name stored in the Categories property of that Outlook item. Because category names are stored as part of the Outlook item, it is possible to have a category name in an Outlook item that is not present in the Master Category List. For example, a category may have been removed.

If a Category object with a corresponding Name property value does not exist in the Categories collection of the NameSpace object that contains the Outlook item, the category name associated with that Outlook item is still displayed, but without an associated color.