Categories.Add method (Outlook)

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

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

Categories Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.