Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Record the position and size of the (only) shape on the current slide

Below macro records the position and size of each shape in the active presentation.

How is the code to be re-written if I only would like to record the position and size of the (only) shape on the current slide?

Help is much appreciated. Thank you very much in advance.

Regards, Andreas




Dim oSl As Slide
    Dim oSh As Shape

    For Each oSl In ActivePresentation.Slides
        For Each oSh In oSl.Shapes
            With oSh
                .Tags.Add Name:="L", Value:=CStr(.Left)
                .Tags.Add Name:="T", Value:=CStr(.Top)
                .Tags.Add Name:="H", Value:=CStr(.Height)
                .Tags.Add Name:="W", Value:=CStr(.Width)
            End With
        Next
    Next

End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of LazyFolk
LazyFolk
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Andreas Hermle

ASKER

Hi LazyFolk,

great this did the trick. Thank you very much for your great help.

Regards, Andreas