Sub 修改特定大小的字
Dim oSl As Slide Dim oSh As Shape Dim sFontName As String Dim Ctr As Integer Dim Cl As Cell
' 这里设定需要改掉的字体大小: nFontSize = '18' ' 这里设定需要修改后的大小: sFontSize = '56' With ActivePresentation For Each oSl In .Slides For Each oSh In oSl.Shapes With oSh Select Case .Type ' 判断组合对象部分 Case msoGroup For Ctr = 1 To .GroupItems.Count If .GroupItems(Ctr).HasTextFrame Then If .GroupItems(Ctr).TextFrame.TextRange.Font.Size = nFontSize Then .GroupItems(Ctr).TextFrame.TextRange.Font.Size = sFontSize End If End If Next Ctr ' 判断表格对象部分 Case msoTable For Ctr = 1 To .Table.Rows.Count For Each Cl In .Table.Rows(Ctr).Cells If Cl.Shape.HasTextFrame Then If Cl.Shape.TextFrame.HasText Then If Cl.Shape.TextFrame.TextRange.Font.Size = nFontSize Then Cl.Shape.TextFrame.TextRange.Font.Size = sFontSize End If End If End If Next Cl Next Ctr ' 判断其他对象(文本框)部分 Case Else If .HasTextFrame Then If .TextFrame.HasText Then If .TextFrame.TextRange.Font.Size = nFontSize Then .TextFrame.TextRange.Font.Size = sFontSize End If End If End If End Select End With Next Next End With End Sub 回复【字体代码】 可以下载代码的txt文件哦 这组代码跟前面的代码有区别哦 对了 |
|