分享

【PPT】如何将大小为24的字瞬间变成大小40?

 你知道我很纠结 2016-03-22





























可爱的代码

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文件哦






















这组代码跟前面的代码有区别哦








对了


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多