Share via


Shortcuts 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 OutlookBarShortcuts collection of shortcuts contained within the specified Outlook Bar group.

expression**.Shortcuts**

expression   Required. An expression that returns an OutlookBarGroup object.

Example

This Microsoft Visual Basic/Visual Basic for Applications example deletes all empty groups in the Outlook Bar.

  Dim myOlApp As New Outlook.Application
Dim myOlBar As Outlook.OutlookBarPane
Dim myOlGroup As Outlook.OutlookBarGroup
Set myOlBar = myOlApp.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

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")
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