Adding builtin commands to a commandbar

A

Andy

I have created a commandbar from vba and wish to add some of the
built-in commands. Are there any constants defined for the built-in
commands, for example Zoom In. I created a macro and added Zoom In to
the command bar. Looking at the generated code, it adds a control with
ID=444. Obviously this isn't ideal from a maintenance point of view.

Thanks
 
C

Chris [Visio MVP]

If you use VB6 or VBA and can get to the Object Browser, you will find a
whole bunch of "vis" commands.

The Visiocommands are organized under VisUICmds, and all start with visCmd.
They are somewhat organized by menu item, although it is somewhat of a
"historical-rolling" organization. Go down the road and turn right, past
where the church used to be...if you get my drift.

If you can't find a command, post here again and maybe one of us Visio
freaks can find it for you.

Here's another couple of ways to find it:

If you install the Visio 2003 SDK, you'll get a nice developer help module.
This link will give you the VisUICmds enumeration:

mk:mad:MSITStore:C:\Program%20Files\Microsoft%20Office%202003\Visio11\SDK\Docs\VisSDK.chm::/html/vienumVisUICmds.htm

In the Developer Help installed with Visio 2003, you can find it via:

Help > Developer Reference >

[help window] > MS Office Visio Automation Reference > Enumerations >
find VisUICmds in the list
 
A

Andy

Thanks for the pointer to the developer help. However, it does not
appear to list these constants used for controls in the command bar.

I am linking an existing built-in commands to my commandbar and am
trying to avoid implmementing macros to call the commands.

So in the case of "Zoom In" I can add the control to my command bar,
giving the ID and FaceID of 444. This is not the same as the
VisCmdZoomIn constant which is 1216.
 

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