0

我有很多幻灯片,每张都有一个艺术字。我希望将艺术字对齐到幻灯片的绝对中心。我试过的代码是:

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
4

1 回答 1

0

也许会有所帮助。

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
于 2017-06-02T09:29:51.517 回答