編輯

共用方式為


_Categories.Add(String, Object, Object) Method

Definition

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

public Microsoft.Office.Interop.Outlook.Category Add (string Name, object Color, object ShortcutKey);
Public Function Add (Name As String, Optional Color As Object, Optional ShortcutKey As Object) As Category

Parameters

Name
String

The name of the new category.

Color
Object

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
Object

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

Returns

A Category object that represents the new category.

Applies to