Toolbars/commandbars does not follow the .mpp file

E

Ebbe

Hi

I have created a new toolbar and added some buttons to it.
I have also created new surfaces (grafic picture) on the buttons.
Pressing the buttons causes some macroes to run.

When I copy the .mpp file to an other computer, all the macroes is copied to
the other computer.
BUT there is no toolbar :-(
How can I copy a toolbar from one computer to an other?

Ebbe
 
J

Jan De Messemaeker

Hi,

Toolbars, when vvisible, are located in Global.mpt
You can copy them into the file through Tools, Organizer.
Reversely, when in the new environment you have to copy the toolbar from the
file into Global.mpt
HTH
 
E

Ebbe

Thanks! It works.

Isn't it possible to activate the toolbar without copying it to Global.mpt?
The toolbar buttons is only interesting when this project is open.

Am I forsed to use the following code to ensure that the toolbar is only
accesseble, when the project is active?
In this case I miss my toolbar if I close a changed project.
If I answer cancel to the prompt for saving, the toolbar is gone because it
was deleted by the Project_BeforeClose.

Code begin --------------------------------------------------
Private Sub Project_Activate(ByVal pj As MSProject.Project)
On Error Resume Next
OrganizerDeleteItem Type:=6, FileName:="Global.MPT", Name:="My_Toolbar"
On Error GoTo 0
OrganizerMoveItem Type:=6, FileName:="My_Project.mpp",
ToFileName:="Global.MPT", Name:="My_Toolbar"
End Sub

Private Sub Project_Deactivate(ByVal pj As MSProject.Project)
On Error Resume Next
OrganizerDeleteItem Type:=6, FileName:="Global.MPT", Name:="My_Toolbar"
On Error GoTo 0
End Sub

Private Sub Project_BeforeClose(ByVal pj As MSProject.Project)
On Error Resume Next
OrganizerDeleteItem Type:=6, FileName:="Global.MPT", Name:="My_Toolbar"
On Error GoTo 0
End Sub
Code end --------------------------------------------------

Or - Is there an easier way?
 
J

Jan De Messemaeker

Hi,

How could you activate it from the file? It isn't even visible in the
customize, toolbar window.
I would definitely leave it in the global. You could have the macro referred
to reside in the file or at least check the active file.
HTH
 
E

Ebbe

As you see in my last post, I found the statements, that copies the toolbar
from my project to Global.mpt.
And when there is no use of it any more, I delete the toolbar from
Global.mpt again.

My concern is that if the user presses the Cancel button, the toolbar is
deleted and because it seems that I can't catch the Cancel to put the
toolbar back again, the user has my project open, but with NO toolbar.

I am looking for a way that secure, that my toolbar is accessible, when my
project is active, and the toolbar is out of rich in any other
circumstances.

Ebbe
 

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