OutlookBarGroups.Add Method

Outlook Developer Reference

Adds a new, empty group to the Shortcuts pane.

Syntax

expression.Add(Name, Index)

expression   A variable that represents an OutlookBarGroups object.

Parameters

Name Required/Optional Data Type Description
Name Required String The name of the group being created.
Index Optional Long The position at which the new group will be inserted in the Shortcuts pane. Position one is at the top of the bar.

Return Value
An OutlookBarGroup object that represents the new group.

Example

This Visual Basic/VBA example adds a group named Marketing as the last group in the Shortcuts pane.

Visual Basic for Applications
  Sub AddGroup()
    Dim myolBar As Outlook.OutlookBarPane
    
    Set myolBar = Application.ActiveExplorer.Panes.Item("OutlookBar")
    myolBar.Contents.Groups.Add "Marketing", myolBar.Contents.Groups.Count + 1
End Sub

See Also