Visio Guy

Visio Discussions => General Visio => Topic started by: lizat on July 03, 2020, 02:13:59 PM

Title: Change a shape to a differnt one (i.e. change the master used)
Post by: lizat on July 03, 2020, 02:13:59 PM
Is it possible to have a shape and then apply a different master? I realise that it may mean a loss or addition of some attributes. I want to do two versions of the same diagram one using 'formal' shapes and one using 'hand-drawn' shapes and see how my users respond. I want to use an existing diagram as they will be familiar with it. So in this case the cahnge of shape is to another one that is very similar e.g. change a rectangle to a hand-drawn rectangle.

Is there any way to do this easily?

Thank you
Title: Re: Change a shape to a differnt one (i.e. change the master used)
Post by: Visisthebest on July 03, 2020, 02:26:30 PM
"In Visio, you can replace any existing shape with an entirely different shape and yet retain all of the original shape's key characteristics—position, connections, formatting, shape text, and shape data."

How? You can read here:

https://support.microsoft.com/en-us/office/replace-one-shape-with-another-176a89ea-9638-4d35-b04b-6eddd0850016

Hope this helps :).
Title: Re: Change a shape to a differnt one (i.e. change the master used)
Post by: lizat on July 03, 2020, 03:24:29 PM
I thought I remembered that i could but couldn't see for looking. thank you!!!
Title: Re: Change a shape to a differnt one (i.e. change the master used)
Post by: vojo on July 03, 2020, 05:22:44 PM
I think you can change the format of a shape in the document stencil ==>  that will effect all shapes in THIS drawing
(colors, geometries, etc)

but I don't think you can actually change the shape to another
Title: Re: Change a shape to a differnt one (i.e. change the master used)
Post by: Yacine on July 03, 2020, 08:02:19 PM
There's actually a built-in theme for your purpose
https://www.tutorialspoint.com/microsoft_visio/microsoft_visio_themes_styles.htm
The fifth row in the picture shows the hand drawn styles.
Title: Re: Change a shape to a differnt one (i.e. change the master used)
Post by: wapperdude on July 04, 2020, 05:28:49 PM
Little late to the party...
Here's code to implement the technique that Vojo identified.

It assumes that the stencil containing the handdrawn shape is part of the document.  In this case, WkyShps.vssx stencil.


Sub ChgMaster()    'Wapperdude
    Dim vShp As Visio.Shape

    For Each vShp In ActivePage.Shapes
        If (vShp.Master Is Nothing) Then
            Debug.Print "This shape has no master"
        Else
            Debug.Print vShp.Master.Name                           'print list of existing masters
            If vShp.Master.Name = "Ellipse" Then
                vShp.ReplaceShape Application.Documents.Item("WkyShps.vssx").Masters.ItemU("WCir")
            End If
        End If
    Next
    Debug.Print ""          'print revised list of masters   
    For Each vShp In ActivePage.Shapes
        Debug.Print vShp.Master.Name 
    Next
End Sub
Title: Re: Change a shape to a differnt one (i.e. change the master used)
Post by: vojo on July 06, 2020, 07:55:34 PM
is there any need to establish the nexus between all the shapes dropped and this replaced master shape in document stenci?
do I even care?
if I copy paste a dropped shape, is a new (old) master shape added to doc stencil?