Outlook) (OutlookBarShortcut.Target 属性
返回一个 variant 类型的值 ,该值指示指定的快捷方式在 快捷方式窗格组中的目标。 此为只读属性。
语法
expression。 Target
表达 一个代表 OutlookBarShortcut 对象的变量。
备注
返回的类型依赖于快捷方式的类型。 如果该快捷方式表示 Outlook 文件夹,则返回的类型是 文件夹 。 如果该快捷方式代表文件系统文件夹,则返回类型为 对象 。 如果该快捷方式代表文件系统路径或 URL,则返回类型是 字符串 。
示例
(VBA) 示例步骤中的第一个 快捷方式窗格组中的快捷方式到此 Microsoft Visual Basic for Applications。 它的计数是 Outlook 文件夹,并显示计数的快捷方式。
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
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。