Document.MasterShortcuts property (Visio)
Returns the MasterShortcuts collection for a document stencil. Read-only.
Syntax
expression.MasterShortcuts
expression A variable that represents a Document object.
Return value
MasterShortcuts
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to use the MasterShortcuts property to get the collection of master shortcuts in a document stencil.
Before running this example, replace the reference to StencilWithShortcuts.vss with a reference to a valid .vss file that contains master shortcuts.
To create a stencil that contains master shortcuts:
Open an existing stencil. (In the Shapes window, click More Shapes, click Open Stencil, and then double-click a stencil.)
Right-click a master in the stencil and click Copy.
Create a new stencil. (In the Shapes window, click More Shapes, and then click New Stencil (US Units) or New Stencil (Metric).)
Right-click the new stencil and click Paste Shortcut.
Save the new stencil. (Right-click its title bar and click Save.)
In the following code, replace StencilWithShortcuts.vss with the name of your new stencil.
Public Sub MasterShortcuts_Example()
Dim vsoMasterShortcuts As Visio.MasterShortcuts
Dim vsoMasterShortcut As Visio.MasterShortcut
Dim vsoStencil As Visio.Document
'Get a stencil that contains some shortcuts.
Set vsoStencil = Application.Documents ("StencilWithShortcuts.vss ")
Set vsoMasterShortcuts = vsoStencil.MasterShortcuts
For Each vsoMasterShortcut In vsoMasterShortcuts
'Print some of the more common properties of a
'master shortcut to the Immediate window.
With vsoMasterShortcut
Debug.Print .AlignName
Debug.Print .DropActions
Debug.Print .IconSize
Debug.Print .ID
Debug.Print .Index
Debug.Print .Name
Debug.Print .NameU
Debug.Print .ObjectType
Debug.Print .Prompt
Debug.Print .ShapeHelp
Debug.Print .Stat
Debug.Print .TargetDocumentName
'Original master where shortcut points
Debug.Print.TargetMasterName
End With
Next
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기