Custom Toolbars with VB (VBA)

K

KemnitzerH

I want to create a custom toolbar with VB/VBA. Everytime my document is
getting startet (=run mode entered) a piece of programm code should create a
toolbar. What is the best strategy? Should I save this toolbar to a file and
load it when I am entering the visio-doc? Or schould built it new?
 
C

Chris Roth [ Visio MVP ]

I usually build it new, since you have to write that code once anyway : )
You can use Command Bars, which are Office-esque, but are always there, or
use Visio's UI object model, which is more flexible.

The latter allows you to customize the UI in the following ways:

- Change Visio's built-in UI
- Change Visio's customized UI
- Change the customized or built-in UIs for only the drawing.

The point is, you should modify the existing UI, in case other people's
solutions have modified the UI. If you modify the built-in UI, then apply it
to your document, or to Visio, you could destroy custom menus from other
solutions.

Check out the Visio developer help or the Visio 2003 SDK for samples on
modifying the UI.

The best place to call your Menu-building code is in
Document_RunModeEntered. This runs when the doc is opened, and also when you
click the VBA design-mode triangle button on and off. Makes it easier to
debug.

--

Hope this helps,

Chris Roth
Visio MVP
 

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