1
我有一个大的PPT文件,需要根据特定规格进行格式化。除非文字加下划线,否则我需要所有字体都是Arial 14。如果文本加下划线,我需要的字体是32.这是我迄今为止的尝试,我有Arial 14部分工作,但我无法弄清楚如何选择下划线的文本。如果任何人有任何想法,将不胜感激。我也有VBA零经验这个项目之外,尽管我熟悉C++在Powerpoint中更改带下划线的文本字体
Sub use()
Dim s As Slide
Dim shp As Shape
For Each s In ActivePresentation.Slides
For Each shp In s.Shapes
If shp.HasTextFrame Then
With shp
.TextFrame.TextRange.Font.Name = "Arial"
.TextFrame.TextRange.Font.Size = 14
If .TextFrame.TextRange.Font.Underline = True Then
.TextFrame.TextRange.Font.Size = 32
End If
With .TextFrame.TextRange
.ParagraphFormat.SpaceBefore = 0
End With
End With
End If
Next shp
Next s
End Sub