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