【发布时间】:2014-11-20 08:16:36
【问题描述】:
我正在尝试将大型演示文稿中的文本框居中对齐。每张幻灯片都包含各种形状,但只有一个带有文本的文本框,我希望该文本框与幻灯片的中心对齐。目前,我有一行代码可以使文本中心在其自己的文本框中对齐,但我想知道是否有办法使文本框位于幻灯片的中间?
Sub TextSize()
Dim oSl As Slide
Dim oSh As Shape
With ActivePresentation
For Each oSl In .Slides
For Each oSh In oSl.Shapes
With oSh
If .HasTextFrame Then
If .TextFrame.HasText Then
.TextFrame.TextRange.Font.Size = 26.5
' change the code to make the text box centre aligned to the slide
.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter
End If
End If
End With
Next
Next
End With
End Sub
【问题讨论】:
标签: vba textbox alignment powerpoint center