OutlookBarGroups.Add method (Outlook)

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 Microsoft Visual Basic for Applications (VBA) example adds a group named Marketing as the last group in the Shortcuts pane.

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

OutlookBarGroups 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.