Visio Guy

Visio Discussions => Programming & Code => Topic started by: kiler40 on April 25, 2015, 05:26:43 AM

Title: find all shapes with name "something*"
Post by: kiler40 on April 25, 2015, 05:26:43 AM
Hello Everybody!
I`m wondering if is possible to programaticalli find all shapes on page that come from a single master
master "main" and shapes "main.1", "main.35" etc.
Thanks in advance
Title: Re: find all shapes with name "something*"
Post by: Croc on April 25, 2015, 05:52:13 AM
Sub ttt()
    For i = 1 To ActivePage.Shapes.Count
        Set shm = ActivePage.Shapes(i).Master
        If Not shm Is Nothing Then
            If StrComp(shm.Name, "main") = 0 Then
Debug.Print ActivePage.Shapes(i).NameID
            End If
        End If
    Next
End Sub
Title: Re: find all shapes with name "something*"
Post by: kiler40 on April 25, 2015, 07:45:27 AM
Thanks !