Assign macro to toolbar button

F

F.H. van Zelm

Hi,

I'm a newbe to Visio (v 2003), so ... probably this is a rather stupid
question.

How can I assign a macro to a custom button in a custom toolbar?
(Assigning to shapes double click is no problem.)

I also use Word, Excel, PPt (and Access). In those programs, you
1 create your macro
2 add a toolbar (Tools-Customize-tab Toolbars)
3 drag a macro button to the new toolbar (tab Commands, category Macros)
4 in Excel, additionally assign the macro

No go in Visio. And the help doesn't ... help.
 
P

Paul Herber

Hi,

I'm a newbe to Visio (v 2003), so ... probably this is a rather stupid
question.

How can I assign a macro to a custom button in a custom toolbar?
(Assigning to shapes double click is no problem.)

I also use Word, Excel, PPt (and Access). In those programs, you
1 create your macro
2 add a toolbar (Tools-Customize-tab Toolbars)
3 drag a macro button to the new toolbar (tab Commands, category Macros)
4 in Excel, additionally assign the macro

No go in Visio. And the help doesn't ... help.

As far as I know this cannot be done in Visio.
 
W

wr

Hi Frans,

In the help section of the visual basic editor you will find an example
called
"toolbars_example". It is in the section 'toolbars property'
Make the following changes to the code:
change vsoToolbarItem.CmdNum = visCmdPanZoom
to
vsoToolbarItem.AddOnName = "ThisDocument.yourmacro"

Run the macro and the result is a toolbar button created at at the left side
of your window which.
Click on the button to activate your macro

René
 

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