TPE

http://bayanbox.ir/view/263405954590585756/2mobile.png

Tavvafi@gmail.com


≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

ActivePresentation.Slides(1).Shapes("Title 1")
Function ShapeWithID(oSl As Slide, lID As Long) As Shape
' Returns a reference to the shape with ID lID
' on slide oSl (or Nothing)
    Dim oSh As Shape
    For Each oSh In oSl.Shapes
        Debug.Print oSh.Id
        If oSh.Id = lID Then
            Set ShapeWithID = oSh
            Exit Function
        End If
    Next
End Function

Use this to test the function:

Sub TestShapeWithID()
    Dim oSh As Shape
    ' Change the slide number and ID as needed:
    Set oSh = ShapeWithID(ActivePresentation.Slides(1), 9)
    If Not oSh Is Nothing Then
        oSh.Select
    End If
End Sub


ActivePresentation.Slides(1).Shapes("Title 1")