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