Refresh shape properties for all pages

F

fcinelli

Hi,
I have a drawing I created using the Organization Chart wizard...based
on a database which contains all the data and Visio maintains a link
between the two. That's all fine and works well, but I would like to
know if there is a way to update the ENTIRE drawing all at once instead
of page by page. In other words, if a change is made in my database, I
want to be able to update all the pages, otherwise, I would have to
right-click on each page in my document (I have 20) and pick "Refresh
Shape Properties."

Is there a way to do this for all pages (perhaps using VBA)? Thanks
 
C

Chris Roth [MVP]

Hi fc,


You could do it with VBA code. First we need the name of the add-on:

- Select nothing on the page
- Choose Window > Show ShapeSheet.
- Look for the Actions section
- Look for a formula in the row that says "Upated Shapes" - something llike
RUNADDONWARGS...
- You'll need the add-on name and the arguments for the code snippet
below...

VBA Code:

------------------------

dim sAddonName as string
dim sAddonArgs as string
dim pg as Visio.Page

sAddonName = "FigureThisOutFromShapeSheet"
sAddonArgs = "FigureThisOutFromShapeSheet

For Each pg in Visio.ActiveDrawing.Pages
visio.Application.Addons(sAddonName ).Run(sAddonArgs)
Next pg

------------------------

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
F

fcinelli

Thanks Chris but I found a solution and it works rather well (for me at
least):
-----
Dim pg As Page

For Each pg In ThisDocument.Pages
ActiveWindow.Page = pg.Name
Visio.Addons("Database Refresh").Run ""
Next
-----
It cycles through each page and refreshes all the shapes...exactly what
I want. When the document opens, I ask the user if he/she wants to
refresh the shapes, if yes, the above procedure is called. I have
something similar for updating the records in the database, just change
"Database Refresh" to "Database Update".

Thanks again...hopefully someone can use this if they run into a
similar issue.
 

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