Yes, it makes a lot of difference!
That version was before Microsoft had the chance to include their Office
stuff in Visio.
The following may work (tested in Visio 2003 using old object model)
Public Sub EnumMenus()
Dim vsoUIObject As Visio.UIObject
Dim mnu As Visio.Menu
Dim mns As Visio.MenuSet
Dim mni As Visio.MenuItem
'Check whether there are custom menus bound to the document.
If ThisDocument.CustomMenus Is Nothing Then
'If not, check whether there are custom menus bound to the
application.
If Visio.Application.CustomMenus Is Nothing Then
'If not, use the Visio built-in menus.
Set vsoUIObject = Visio.Application.BuiltInMenus
Debug.Print "Using Built-InMenus"
Else
'If there are existing Visio application-level custom menus, use
them.
Set vsoUIObject = Visio.Application.CustomMenus
Debug.Print "Using Custom Menus"
End If
Else
'Use the existing custom menus.
Set vsoUIObject = ThisDocument.CustomMenus
Debug.Print "Using Custom Menus"
End If
Set mns = vsoUIObject.MenuSets.Item(0)
For i = 0 To mns.Menus.Count - 1
Set mnu = mns.Menus.Item(i)
If mnu.Caption = "&Gantt Chart" Then
For j = 0 To mnu.MenuItems.Count - 1
Set mni = mnu.MenuItems.Item(j)
Debug.Print j, mni.Caption, mni.ActionText, mni.AddOnName,
mni.AddOnArgs, mni.CmdNum, mni.TypeSpecific1, mni.TypeSpecific2
Next j
End If
Next i
End Sub
This is the output in Visio 2003:
0 &Link Tasks GC /CMD=2560
0 -1 0
1 &Unlink Tasks GC /CMD=2570
1 -1 0
2
0 -1
0
3 Outde&nt GC /CMD=2580
2 -1 0
4 In&dent GC /CMD=2590
3 -1 0
5
0 -1
0
6 Insert Colu&mn... GC
/CMD=2500 7004 -1 0
7 &Hide Column GC /CMD=2510
5 -1 0
8 New T&ask GC /CMD=2540
6 -1 0
9 Delete Tas&k GC /CMD=2550
7 -1 0
10
0 -1
0
11 Option&s... GC /CMD=2520
8 -1 0
12 Configure &Working Time... GC
/CMD=2530 7009 -1 0
13
0 -1
0
14 Im&port... GCIMP
7010 -1 0
15 E&xport... GCEXP
7011 -1 0