Class OutlookBarGroups (Outlook VBA)
Contains a set of OutlookBarGroup objects representing all groups in the Outlook Bar. To use a OutlookBarGroups class variable it first needs to be instantiated, for example
Dim obgs as OutlookBarGroups
Set obgs = ActiveExplorer.Panes(1).Contents.Groups
Add
Adds a new, empty group to 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
Arguments
The following argument is required
Name (String) - The name of the group being created.
Optional arguments
The following argument is optional
Index (Long) - The position at which the new group will be inserted in the Shortcuts pane. Position one is at the top of the bar.
Class
Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for
Dim oocsClass As OlObjectClass
oocsClass = ActiveExplorer.Panes(1).Contents.Groups.Class
Count
Returns a Long indicating the count of objects in the specified collection.
Dim lngCount As Long
lngCount = ActiveExplorer.Panes(1).Contents.Groups.Count
Item
Returns an OutlookBarGroup object from the collection.
Item (Index)
Index: Either the index number of the object, or a value used to match the default property of an object in the collection.
Dim obg As OutlookBarGroup
Set obg = ActiveExplorer.Panes(1).Contents.Groups(Index:=1)
Remove
Removes an object from the collection.
Remove (Index)
Index: The name or 1-based index value of an object within a collection.
Dim lngIndex As Long: lngIndex =
ActiveExplorer.Panes(1).Contents.Groups.Remove Index:=lngIndex
Session
Returns the NameSpace object for the current session.
The Session property and the GetNamespace method can be used interchangeably to obtain the NameSpace object for the current session. Both members serve the same purpose. For example, the following statements do the same function: