Share via


Groups Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

Returns an OutlookBarGroups object representing the set of groups in an Outlook Bar.

expression**.Groups**

expression   Required. An expression that returns an OutlookBarStorage object.

Example

The following Microsoft Visual Basic/Visual Basic for Applications example displays the number of groups in the Outlook Bar.

  Dim myOlApp As New Outlook.Application
Dim myOlBar As Outlook.OutlookBarPane
Set myOlBar = myOlApp.ActiveExplorer.Panes.Item("OutlookBar")
myCount = myOlBar.Contents.Groups.Count
MsgBox "There are " & myCount & " groups in the Outlook Bar"

If you use VBScript, you do not create the Application object. This example shows how to perform the same task using VBScript.

  Set myOlBar = Application.ActiveExplorer.Panes.Item("OutlookBar")
myCount = myOlBar.Contents.Groups.Count
MsgBox "There are " & myCount & " groups in the Outlook Bar"