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

Concepts

OutlookBarGroups Object

OutlookBarGroups Object Members