Visio macros for ALL Visio files??

B

billcalley

Hi all,

No matter what I do, when I create a macro in Visio, that macro
only works in the file I created it in, and not in any files other
that I have already created. That is useless too me, because I want
my macro to format a footer for me, and I have 600 files it must do
this to (one at a time -- but I wish it could do this globaly, but
that's too much to ask)! Is there any way at all to make the new
macro available to any and all open Visio files? (I have Visio 2003
SP2)

Thanks!

-Bill
 
C

Chris Roth [MVP]

Hi Bill,

Yes, you're right, there's no "Normal.dot" to hold your "global macros" in
Visio.

But, you could just put the code in a blank Visio drawing, minimize it, then
run the macro against all other drawings.

You can even have your VBA-macro-document open another session of Visio and
do all the work in that "other" Visio.

dim visApp as Visio.Application
set visApp = New Visio.Application

or

Set visApp = GetObject(, "visio.application")

to get an already-running instance of Visio.

--
Hope this helps,

Chris Roth
Visio MVP

Register today for the 2008 Microsoft Office Visio Conference!
http://www.msvisioconference.com/

Visio Guy: Smart Graphics for Visual People
http://www.visguy.com
 
B

billcalley

Hi Bill,

Yes, you're right, there's no "Normal.dot" to hold your "global macros" in
Visio.

But, you could just put the code in a blank Visio drawing, minimize it, then
run the macro against all other drawings.

You can even have your VBA-macro-document open another session of Visio and
do all the work in that "other" Visio.

dim visApp as Visio.Application
set visApp =  New Visio.Application

or

Set visApp = GetObject(, "visio.application")

to get an already-running instance of Visio.

--
Hope this helps,

Chris Roth
Visio MVP

Register today for the 2008 Microsoft Office Visio Conference!
 http://www.msvisioconference.com/

Visio Guy: Smart Graphics for Visual People
 http://www.visguy.com







- Show quoted text -


Thanks so much Chris -- that great info has saved my hide!!

Best Regards,

-Bill
 
J

John Marshall, MVP

There is some sample VBA code at http://visio.mvps.org/VBA.htm that shows
you how to loop through a collection of Visio drawings in the current
directory. (Look for Directory Process)

The other thing to check out is background pages versus Headers & Footers.
In Visio H&Fs were added to address a specific problem. The normal Visio way
is to use Background pages instead of H&Fs. H&Fs are limited compared to
Background pages.

John... Visio MVP

Need stencils or ideas? http://visio.mvps.org/3rdparty.htm
Need VBA examples? http://visio.mvps.org/VBA.htm
Visio Wishlist http://visio.mvps.org/wish_list.htm
Hi Bill,

Yes, you're right, there's no "Normal.dot" to hold your "global macros" in
Visio.

But, you could just put the code in a blank Visio drawing, minimize it,
then
run the macro against all other drawings.

You can even have your VBA-macro-document open another session of Visio
and
do all the work in that "other" Visio.

dim visApp as Visio.Application
set visApp = New Visio.Application

or

Set visApp = GetObject(, "visio.application")

to get an already-running instance of Visio.

--
Hope this helps,

Chris Roth
Visio MVP

Register today for the 2008 Microsoft Office Visio Conference!
http://www.msvisioconference.com/

Visio Guy: Smart Graphics for Visual People
http://www.visguy.com







- Show quoted text -


Thanks so much Chris -- that great info has saved my hide!!

Best Regards,

-Bill
 
B

billcalley

There is some sample VBA code athttp://visio.mvps.org/VBA.htmthat shows
you how to loop through a collection of Visio drawings in the current
directory. (Look for Directory Process)

The other thing to check out is background pages versus Headers & Footers.
In Visio H&Fs were added to address a specific problem. The normal Visio way
is to use Background pages instead of H&Fs. H&Fs are limited compared to
Background pages.

John...    Visio MVP

Need stencils or ideas?http://visio.mvps.org/3rdparty.htm
Need VBA examples?  http://visio.mvps.org/VBA.htm












Thanks so much Chris -- that great info has saved my hide!!

Best Regards,

-Bill- Hide quoted text -

- Show quoted text -

Thanks John for that further helpful info -- I have never worked with
Background pages, but will look into it right now!
Best Regards,

-Bill
 

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