Share via


_Categories.Add Method

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

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
Function Add ( _
    Name As String, _
    Color As Object, _
    ShortcutKey As Object _
) As Category
'Usage
Dim instance As _Categories
Dim Name As String
Dim Color As Object
Dim ShortcutKey As Object
Dim returnValue As Category

returnValue = instance.Add(Name, Color, _
    ShortcutKey)
[DispIdAttribute()]
Category Add(
    string Name,
    Object Color,
    Object ShortcutKey
)

Parameters

  • Color
    Type: System.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
    Type: System.Object

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

Return Value

Type: Microsoft.Office.Interop.Outlook.Category
A Category object that represents the new category.

See Also

Reference

_Categories Interface

_Categories Members

Microsoft.Office.Interop.Outlook Namespace

Other Resources

How to: Enumerate and Add Categories