Table of contents
TOC
Inhaltsverzeichnis reduzieren
Inhaltsverzeichnis erweitern

AccelTable.AccelItems-Eigenschaft (Visio)AccelTable.AccelItems Property (Visio)

office 365 dev account|Zuletzt aktualisiert: 06.03.2018
|
2 Mitarbeiter

Gibt die AccelItems -Auflistung ein AccelTable -Objekt zurück. Schreibgeschützt.Returns the AccelItems collection of an AccelTable object. Read-only.

SyntaxSyntax

Ausdruck . AccelItemsexpression . AccelItems

Ausdruck Eine Variable, die ein AccelTable -Objekt darstellt.expression A variable that represents an AccelTable object.

RückgabewertReturn Value

AccelItemsAccelItems

BeispielExample

Der folgende Microsoft Visual Basic für Applikationen (VBA)-Makro veranschaulicht, wie die AccelItems -Eigenschaft zum Löschen einer Zugriffstaste aus einem integrierten Menü verwendet wird.The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the AccelItems property to delete an accelerator key from a built-in menu.

Um die integrierten Menüs in Microsoft Visio wiederherzustellen, nachdem Sie dieses Makro ausgeführt, rufen Sie die ThisDocument.ClearCustomMenus -Methode.To restore the built-in menus in Microsoft Visio after you run this macro, call the ThisDocument.ClearCustomMenus method.


Public Sub AccelItems_Example() 

 Dim vsoUIObject As Visio.UIObject 
 Dim vsoAccelTable As Visio.AccelTable 
 Dim vsoAccelItems As Visio.AccelItems 
 Dim vsoAccelItem As Visio.AccelItem 
 Dim intCounter As Integer 

 'Retrieve the UIObject object for the copy of the built-in menus. 
 Set vsoUIObject = Visio.Application.BuiltInMenus 

 'Set vsoAccelTable to the drawing menu set. 
 Set vsoAccelTable = vsoUIObject.AccelTables.ItemAtID(visUIObjSetDrawing) 

 'Retrieve the accelerator items collection. 
 Set vsoAccelItems = vsoAccelTable.AccelItems 

 'Retrieve the accelerator item for the Visual Basic Editor. 
 'To do this, we must iterate through the collection 
 'and locate the item we want to manipulate. 
 'The item can be identified either by checking 
 'the CmdNum property or by checking for the specific key. 
 'Because checking for the key requires looking at the Alt, 
 'Control, Shift, and Key properties, it is better to use the 
 'CmdNum property. Because we retrieved the built-in menus, 
 'we know that we can find the accelerator. 
 For intCounter = 0 To vsoAccelItems.Count - 1 

 Set vsoAccelItem = vsoAccelItems.Item(intCounter) 
 If vsoAccelItem.CmdNum = Visio.visCmdToolsRunVBE Then 

 Exit For 

 End If 

 Next intCounter 

 'Delete the accelerator. 
 vsoAccelItem.Delete 

 'Tell Visio to use the new UI. 
 ThisDocument.SetCustomMenus vsoUIObject 

End Sub
© 2018 Microsoft