Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.9 KB

Outlook.OutlookBarShortcut.Target.md

File metadata and controls

66 lines (45 loc) · 1.9 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
OutlookBarShortcut.Target property (Outlook)
vbaol11.chm343
vbaol11.chm343
Outlook.OutlookBarShortcut.Target
990671c0-bfc5-6b09-26a1-1cdf9d0e143b
06/08/2017
medium

OutlookBarShortcut.Target property (Outlook)

Returns a Variant indicating the target of the specified shortcut in a Shortcuts pane group. Read-only.

Syntax

expression. Target

expression A variable that represents an OutlookBarShortcut object.

Remarks

The return type depends on the shortcut type. If the shortcut represents an Outlook folder, the return type is Folder. If the shortcut represents a file-system folder, the return type is an Object. If the shortcut represents a file-system path or URL, the return type is a String.

Example

This Microsoft Visual Basic for Applications (VBA) example steps through the shortcuts in the first Shortcuts pane group. It counts the number of shortcuts that are Outlook folders and displays the count.

Sub DeleteShortcuts() 
 Dim myOlBar As Outlook.OutlookBarPane 
 Dim myolGroup As Outlook.OutlookBarGroup 
 Dim myOlShortcuts As Outlook.OutlookBarShortcuts 
 Dim myOlShortcut As Outlook.OutlookBarShortcut 
 Dim myTop As Integer 
 Dim x As Integer 
 Dim count As Integer 
 
 Set myOlBar = Application.ActiveExplorer.Panes.Item("OutlookBar") 
 Set myolGroup = myOlBar.Contents.Groups.Item(1) 
 Set myOlShortcuts = myolGroup.Shortcuts 
 myTop = myOlShortcuts.Count 
 For x = myTop To 1 Step -1 
 Set myOlShortcut = myOlShortcuts.Item(x) 
 If TypeName(myOlShortcut.Target) = "Folder" Then 
 count = count + 1 
 End If 
 Next x 
 MsgBox ("Number of shortcuts that are Outlook folders:" & count) 
End Sub

See also

OutlookBarShortcut Object

[!includeSupport and feedback]