Exporting Timelines

V

visdev1

I am was wondering if anyone new the name of the wizard that allowed you to
export a gantt chart. When you have a gantt chart up, there is new menu
option that allows you to import and export the chart. If you export then it
makes a .MXP file and i need to find that wizard or find out how to generate
my own.
Thanks for any help.
 
D

David Parker [Visio MVP]

The Gantt Chart menu item should be visible before the Window item on the
main toolbar.
Then select Export
 
V

visdev1

Yes and I need to know what is behind that button. I would like to call that
button using vba. See i am replacing that gantt menu option with one of my
own and i want to keep some of the buttons and i cant find the what that
button is using to export the chart as a mpx.
thanks
 
D

David Parker [Visio MVP]

Then you may want to write a little vba to iterate thru the menu items to
see what commands they are calling?
 
V

visdev1

Ok, but what objects, collections, or commands do i need to use to go threw
and see what they are calling?
I am currently going threw the visio menus collection but i am having a hard
time finding any names
Also thanks for your help.
 
V

visdev1

what i ment by finding a name is that i went threw the menus collection and
found from file to help but didn't see the Gantt Chart menu option. So u see
i can't seem to track down the export prart of the Gantt Chart menu option.
 
D

David Parker [Visio MVP]

This might help:

Public Sub EnumCommands()
Dim cb As Office.CommandBar
Dim ctl As Office.CommandBarControl
Dim cb1 As CommandBar

For Each cb In Visio.Application.CommandBars
If cb.Name = "Gantt Chart" Then
Debug.Print cb.Name, cb.NameLocal
For Each ctl In cb.Controls
Debug.Print , ctl.Parameter, ctl.Caption,
ctl.DescriptionText
Next ctl
End If
Next cb
End Sub
 
V

visdev1

Its hanging up on Visio.Application.CommandBar

It says it doen's support the .CommandBar

Iam using visio 2000 standard if that helps any
thanks
 
D

David Parker [Visio MVP]

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
 
V

visdev1

Thanks so much!
I have been looking and asking for this for a while.
The only correction i had to make was:
from:
Set mns = vsoUIObject.MenuSets.Item(0)
to:
Set mns = vsoUIObject.MenuSets.Item(1)

Thanks again for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top