Class OutlookBarGroup (Outlook VBA)

The class OutlookBarGroup represents a group of shortcuts in the Shortcuts pane of an explorer window. To use a OutlookBarGroup class variable it first needs to be instantiated, for example


Dim obg as OutlookBarGroup
Set obg = ActiveExplorer.Panes(1).Contents.Groups(Index:=1)

For Each

Here is an example of processing the OutlookBarGroup items in a collection.


Dim obgGroup As OutlookBarGroup
For Each obgGroup In ActiveExplorer.Panes(1).Contents.Groups
	
Next obgGroup

Class

Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for OlObjectClass.


Dim oocsClass As OlObjectClass
oocsClass = ActiveExplorer.Panes(1).Contents.Groups(1).Class

Name

Returns or sets a String value that represents the display name for the object.


ActiveExplorer.Panes(1).Contents.Groups(1).Name =

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:

Shortcuts

Returns an OutlookBarShortcuts collection of shortcuts contained within the Shortcuts pane.


Sub DeleteEmptyGroups() 
 Dim myOlBar As Outlook.OutlookBarPane 
 Dim myOlGroup As Outlook.OutlookBarGroup 
 Dim x As Integer 
 
 Set myOlBar = Application.ActiveExplorer.Panes.Item("OutlookBar") 
 For x = myOlBar.Contents.Groups.Count To 1 Step -1 
 Set myOlGroup = myOlBar.Contents.Groups.Item(x) 
 If myOlGroup.Shortcuts.Count = 0 Then 
 myOlBar.Contents.Groups.Remove x 
 End If 
 Next x 
End Sub

ViewType

Returns or sets an OlOutlookBarViewType constant representing the view type of an OutlookBarGroup object. Possible return values are olLargeIcon - The Outlook Bar group displays large icons, olSmallIcon - The Outlook Bar group displays small icons.

This property does not have any effect on the icons displayed in the Shortcuts pane. Large icons have been removed and if this property is set to olLargeIcon, it will not have any effect. In previous versions of Microsoft Outlook, it returns or sets the icon view displayed by the specified Outlook Bar group.


ActiveExplorer.Panes(1).Contents.Groups(1).ViewType = olLargeIcon