Partager via


Categories.Add Method (Outlook)

Creates a new Category object and appends it to the Categories collection.

Version Information

Version Added: Outlook 2007

Syntax

expression .Add(Name, Color, ShortcutKey)

expression A variable that represents a Categories object.

Parameters

Name

Required/Optional

Data Type

Description

Name

Required

String

The name of the new category.

Color

Optional

OlCategoryColor

The color for the new category. If no value is specified, the new category is set to the first color (as specified in the order of the OlCategoryColor enumeration) that is the least used, That is, if there are unused colors, the new category is set to the first unused color in the OlCategoryColor enumeration. If all colors in the OlCategoryColor enumeration have been used, then the new category is set to the first color that is used least in the OlCategoryColor enumeration.

ShortcutKey

Optional

OlCategoryShortcutKey

The shortcut key for the new category. If no value is specified, the default value is OlCategoryShortcutKeyNone.

Return Value

A Category object that represents the new category.

See Also

Concepts

Categories Object Members

Categories Object