V2002 vs V2003, and Command Bars and UI

B

ben h

I have Visio 2003, and I'm writing a set of macros for clients who have
V2002 OR V2003. I guess it could be called a custom solution, or
application.

Firstly, if I only have Office 11.0, what can I do to develop for people
who only have Office 10.0?

Secondly, what are the top 5 things I need to be careful of while I'm
writing macros in V2003 noting that my audience may only have V2002?

Thirdly, what can I use to create Command Bars, or Menus or some other
UI device by which users can click a button to run my macros, instead of
going through the pain of Tools > Macros > ... etc?

I also have VS.NET 2002 but haven't used it as yet, I'm only experienced
in VBA environments.

Ben
 
C

Chris [Visio MVP]

Here's a couple of quick tips:

In the Developer Help, properties & methods note in which version they were
introduced, so you can check compatibility. Also, in Visio 2003, there's a
"what's new" section. That might serve as a "don't use" list.

The Command Bar path for adding menus is good for add-ins you write that
should always be available to users. But for more sophisticated control, the
Visio "UI object model" is better. You can add menus just to drawings of
certain types, for instance. Again the developer help is good for examples,
or even better, Google on: "Visio 2003 SDK" to get a better help file and
loads of samples, and a code librarian full of snippets.
 
R

Roger

Hello Ben

Just to add a few points to those made by Chris:

I've been developing software for use with Visio since version 3 and have
generally found Visio to be “upwards compatibleâ€. At present I support a
number of programs which can all be used with Visio 5, 2000, 2002 or 2003.
The trick is to develop using the lowest common denominator, i.e. the oldest
version you need to support and then test with all the newer versions. I
developed these particular programs with VB6 and reference the Visio 5
VISLIB32.DLL Type Library. Using this library helps ensure you don’t
accidentally use new features that were only added in one of the later
versions.

With VBA you may be able to develop using Visio 2003 and then save the
stencil or document in Visio 2002 format, but I still think it would be
better to develop using Visio 2002. Obviously you’ll need to distribute your
solution in Visio 2002 format files as those with earlier versions would not
be able to open Visio 2003 files.

It’s relatively easy to install and use several versions of Visio on same
computer.

Don’t forget that you can use shape double-click events or right-click menus
to start your programs or macros as an alternative to adding menus or
toolbars into Visio.

Best regards
Roger Billsdon
 
B

ben h

Thanks Chris and Roger, I've tried the Office Command Bars route for the
time being, though come up against a small issue.

The way my 'solution' works is each client has a custom drawing file (a
..vst template) with their colours and logo etc, and my macros are housed
in a stencil file that can be used across all client templates.

I create the CB through the Stencil's Document_DocumentOpened event. I
delete the CB via the Stencil's Document_BeforeDocumentClose event,
however this doesn't seem to fire if I close the drawing file before the
Stencil. It fires as expected if I close the Stencil file first though,
but who's going to do that?

Is there any solution to this problem? Is this an issue that is better
handled using Visio's UIObject object model?

Cheers,
Ben
 
R

Roger

I think VBA is fine for relatively simple, small scale applications but for
more complex work VB or C# are more appropriate when you can justify the
extra learning effort over a longer development timescale.

Graham Wideman's excellent "Visio 2003 Developer's Survival Pack" book may
help you make the choice between CommandBars and the Visio UI model. It
devotes almost 30 pages to the comparison and the general conclusion is that
the Visio UI model is the more flexible and powerful option. The main
exception is if you need to share code with other Microsoft Office programs.

Hope this helps
Roger Billsdon
 

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