find all shapes with name "something*"

Started by kiler40, April 25, 2015, 05:26:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kiler40

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

Croc

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