Refreshing shapes from master

  • Thread starter -CaptainPugwash-
  • Start date
C

-CaptainPugwash-

I've got a Visio drawing with about 300 instances of a master shape. When I
change some of the properties of the master shape it updates all the
instances as expected, after it prompts me for whether I want to update all
the instances of the master shape.

However, I want to make a change to the master shape with some VBA code and
get all the instances to update automatically. I have written some code
that seems to do this, but it doesn't always update all the instances.
Could someone paste a snippet of code that would do this to check that I am
on the correct lines, and furthermore, is there a way in VBA to tell it to
update all the instances after a change has been made to the master shape
(as the prompt would usually do, if the changes were made manually to the
master).

Many thanks.

PugWash
 
M

Mark Nelson [MS]

Working with Masters programmatically is quite similar to working with them
in the UI. You open the master for editing, make your changes and then
close the edit session to save changes and update shape instances. A full
explanation and example can be found in the help topic for Master.Open.

Here are the key statements:

Dim MasterCopy as Visio.Master
Set MasterCopy = YourMaster.Open
....
'Make all changes to MasterCopy object
....
MasterCopy.Close
 

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