0

I have a lot of slides, each with a single word art. I wish to align the word art to the absolute centre of the slide. the code I have tried is:

Option Explicit

Sub format()

    Dim sl As Slide
    Dim ob As Object

    For Each sl In ActivePresentation.Slides

        For Each ob In sl.Shapes
            With ob.TextFrame
                 '  .TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignCenter
                 '  .TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignMiddle
                 .HorizontalAnchor = msoAnchorCenter
                 .VerticalAnchor = msoAnchorMiddle

             End With

         Next ob

    Next sl

End Sub
Scott
  • 1,863
  • 2
  • 24
  • 43

1 Answers1

0

Maybe it wil help.

Option Explicit

Sub format()

Dim sl As Slide

    For Each sl In ActivePresentation.Slides
        sl.Shapes.Range.Align msoAlignCenters, msoTrue

        sl.Shapes.Range.Align msoAlignMiddles, msoTrue
    Next sl

End Sub
Gadziu
  • 657
  • 7
  • 21