Update shape instances when master shape is changed

VISIO

    Sponsored Links

    Next

  • 1. Visio 2002 shapes with user sections migrating to Visio 2003
    Hello, I am getting strange behaviour with Visio 2002 shapes that have user section variables and are opened in Visio 2003 1. The section delete command when applied to the user section appear to work but when you create a new user section all the rows in the prior section reappear. Similarly with the row delete commands. When you inswert a new row all the prior rows you have deleted reappear. 2. Code written in Visio 2002 referencing cells in the Action section looks like it will need special handling in 2003 because cell names have changed. Is this true or am i just confused by the universal and local names that are displayed. Any help would be greatly appreciated. Thank You, Pat
  • 2. Resizetofitcontents visio 2003 bug
    For some reason the resizetofitcontents doesn't appear to work for the activepage object in 2003 anymore - you have to set a page object to the activepage and then resize the page object, instead of just resizing the activepage directly (which worked fine in Visio 2002). I'm using 2003 SP-1. Anyone else see this problem?
  • 3. Active Links available from background layer
    How do I make the URLs, links (ctrl-K), embedded in a background layer clickable throughout the primary pages in a prototype design? We are tying to save having to enter the same link for the primary navigation for each page. Any tips? -- Truman
  • 4. How to display document properties on drawing?
    Hi, I am trying to display some document related info in the Visio drawing that I programmatically create in my application such as creator, date/time etc. What is the best way to do it? Do I have to use a shape for it?
  • 5. Arrrgh, SaveAsWeb object is disabled
    I'm trying to write a simple VBScript to loop through the files in a directory and run the SAW object against each of them. I can't create the Visio.SaveAsWeb object directly - I'd imagine it's because I'm in scripting-land? - and when I create a Visio.Application or Visio.Invisibleapp object and grab SaveAsWeb out of the .addons collection none of the methods work and the .Enabled property is false, see code below. Does anyone know if there's a way for me to do this in VBScript? Thanks, banzai256 -------------------------------------------- Public Sub SaveAsWeb (VisioFile) Dim vsoApp Dim vsoSaveAsWeb Set vsoApp = CreateObject("Visio.Invisibleapp") Set vsoSaveAsWeb = vsoApp.addons.Item("SaveAsWeb") WScript.Echo("SaveAsWeb.Enabled = " & vsoSaveAsWeb.Enabled & vbCrLf) vsoApp.Quit End Sub SaveAsWeb ("C:\SaveAsWebTest.vsd") --------------------------------------------

Update shape instances when master shape is changed

Postby -CaptainPugwash- » Wed, 09 Mar 2005 04:42:11 GMT

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



Re: Update shape instances when master shape is changed

Postby junethesecond » Wed, 09 Mar 2005 09:48:35 GMT

There are VBA examples in
 http://www.**--****.com/ 
, or in Visio2003 SDK, but, I think, more easy way is to open your code
here, and make every body can look your code.


Re: Update shape instances when master shape is changed

Postby Chris Roth [ Visio MVP ] » Fri, 11 Mar 2005 08:36:27 GMT

Might be the old master copy deal. Assuming your master contains only one 
(grouped if necessary) shape inside of the master container, do this:

Dim mst as Visio.Master, mstCopy as Visio.Master
Dim shp as Visio.Shape

Set mst = Visio.ActiveDocument.Masters("CapnP")
Set mstCopy = mst.Open

    Set shp = mstCopy.Shapes(1)
    shp.Cells("Prop.FirstMate").Formula = Chr(34) & "Gilligan" & Chr(34)
    '....
    Set shp = Nothing

mst.Close

set mstCopy = Nothing
Set mst = Nothing



-- 

Hope this helps,

Chris Roth
Visio MVP









Similar Threads:

1.Getting shape instances to update when master's dimensions are changed

I have a shape master that is a rectange with some text inside it.
When I edit it to make it longer (to fit more text in it), the instances of
the master on the page do not update.
Can anyone help me with this please?

Many thanks.


2.when update master shape, instances on page not updated

I'm making a diagram with many shapes on it, all with the same fill, text 
style, line, and connector locations. I need the flexibility to be able to 
update them all at once if, for example, I change the fill color or add a 
couple of connection points.  I'm using Visio Pro 2003 SP2.

I thought the solution was to make a new master shape, but I can't make the 
shapes already on the page update to match the master when I change the 
master. Here's what I did so far:

I carefully followed the help directions to create a new master shape and to 
save the stencil I had it on. I then dragged it on to the page to make 
several instances of that shape in a drawing. Then I edited the master shape 
and re-saved the stencil. The help claims that doing so will automatically 
update any instances of that shape on the page. It did not. 

So I read a little further and found that you can also supposedly 
right-click on the instance of the shape on the page and use Format > Style 
and set the Text, Line, and Fill styles back to "use master's format." So I 
did that. That didn't work, either.

Any suggestions?

Jen

3.shape: finding link to master stencil shape?

Is it possible...

to find the master object in the stencil from a shape on the page?

The reason is...

I'd to like to set a property on the master shape in the stencil, that 
can be read when I examine each shape on a page.*

I'd also like to then change the value of the property on the master, so 
that it can be read on each instance on the page.

* I can do this by setting the prompt value on the master, and access it 
via 'shape.Master.prompt', this thought doesn't get updated when I 
change the value on master shape in the stencil.

Anyone have ideas?

Thanks
Jeff.

4.Instances doesn't get updated when the master stencil changes

Hi,

I am trying to create a stencil master shape in such way that when I change 
the master, all instances also get updated according to the new master 
shape.

At this point I have a master shape in a stencil and I have hundreds of 
instances in different visio drawing based on the very same stencil. When I 
change the master shape, I have to change all instances (several hundreds) 
and this is such a pain.

How can I solve this problem?

Any help would be appreciated,
Max 




Return to VISIO

 

Who is online

Users browsing this forum: No registered users and 75 guest