OutlookBarPane.Contents Property (Outlook)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns the OutlookBarStorage object for the specified Outlook Bar pane. Read-only.

expression .Contents

expression A variable that represents an OutlookBarPane object.

This Microsoft Visual Basic for Applications example displays a message listing the groups in the Outlook Bar.

Sub ListGroups() 
 
 Dim myOlBar As Outlook.OutlookBarPane 
 
 Dim myOlGroups As Outlook.OutlookBarGroups 
 
 
 
 myMsg = "The groups in the Outlook Bar are:" 
 
 Set myOlBar = Application.ActiveExplorer.Panes.Item("OutlookBar") 
 
 Set myOlGroups = myOlBar.Contents.Groups 
 
 For x = 1 To myOlGroups.Count 
 
 myMsg = myMsg & Chr(13) & myOlGroups.Item(x) 
 
 Next x 
 
 MsgBox myMsg 
 
End Sub
Show: