X
xargon
Hi everyone,
I am trying to remove all keyboard accelerators programatically from the
open Visio document. I tried a function like this but this does not seem
to work
Public Sub RemoveAccelerators()
Dim uiObj As Visio.UIObject
Dim accelTableObj As Visio.AccelTable
Dim accelItemsObj As Visio.AccelItems
Dim accelItemObj As Visio.AccelItem
Dim i As Integer
'Retrieve the UIObject object for the copy of
'built-in menus.
Set uiObj = Visio.Application.BuiltInMenus
'Set accelTableObj to the Drawing menu set.
Set accelTableObj = uiObj.AccelTables.ItemAtID(visUIObjSetDrawing)
'Retrieve the accelerator items collection.
Set accelItemsObj = accelTableObj.AccelItems
'Retrieve the accelerator item for the Visual Basic Editor by
iterating
'through the accelerator items collection and locating the item you
want to delete.
For i = accelItemsObj.count - 1 To 0 Step -1
accelItemsObj.Item(i).Delete
Next i
'Tell Visio to use the new custom menus while the document is active.
ThisDocument.SetCustomMenus uiObj
End Sub
Can someone help me. I am wondering what I am doing wrong. if I search for
a particular accelerator in the list and delete it, it works fine. However,
deleting all the accelerators in the list seems to have no effect!
Thanks and cheers!
xargon
I am trying to remove all keyboard accelerators programatically from the
open Visio document. I tried a function like this but this does not seem
to work
Public Sub RemoveAccelerators()
Dim uiObj As Visio.UIObject
Dim accelTableObj As Visio.AccelTable
Dim accelItemsObj As Visio.AccelItems
Dim accelItemObj As Visio.AccelItem
Dim i As Integer
'Retrieve the UIObject object for the copy of
'built-in menus.
Set uiObj = Visio.Application.BuiltInMenus
'Set accelTableObj to the Drawing menu set.
Set accelTableObj = uiObj.AccelTables.ItemAtID(visUIObjSetDrawing)
'Retrieve the accelerator items collection.
Set accelItemsObj = accelTableObj.AccelItems
'Retrieve the accelerator item for the Visual Basic Editor by
iterating
'through the accelerator items collection and locating the item you
want to delete.
For i = accelItemsObj.count - 1 To 0 Step -1
accelItemsObj.Item(i).Delete
Next i
'Tell Visio to use the new custom menus while the document is active.
ThisDocument.SetCustomMenus uiObj
End Sub
Can someone help me. I am wondering what I am doing wrong. if I search for
a particular accelerator in the list and delete it, it works fine. However,
deleting all the accelerators in the list seems to have no effect!
Thanks and cheers!
xargon