全部显示

Groups 属性

       

返回代表 Outlook 面板中的组集的 OutlookBarGroups 对象。

expression.Groups

expression  必选。该表达式返回 OutlookBarStorage 对象。

示例

以下 Microsoft Visual Basic/Visual Basic for Applications 示例显示 Outlook 面板中组的数目。

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"

如果使用 VBScript,则不必创建 Application 对象。本示例说明如何使用 VBScript 执行相同任务。

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