用Office PowerPoint制作幻灯片时,微软雅黑是一款视觉效果较好的字体,而且所有Office都预置了该字体,不用担心字体未安装的情况。如何一键修改PPT所有内容的字体为“微软雅黑”?这里分享一个VBA小工具。文章来源地址https://www.toymoban.com/news/detail-770513.html
Sub SetAllFontToYahei()
''' set all fonts to 微软雅黑
Dim sld As Slide
Dim shp As Shape, chd As Shape
Dim i&, j&
For Each sld In ActivePresentation.Slides
i = i + 1
Debug.Print "Slide " & i
For Each shp In sld.Shapes
j = j + 1
Debug.Print vbTab & "Shape " & j
If shp.Type = msoGroup Then
For Each chd In shp.GroupItems
If chd.HasTextFrame Then
chd.TextFrame.TextRange.Font.Name = "微软雅黑"
chd.TextFrame.TextRange.Font.NameFarEast = "微软雅黑"
End If
Next
ElseIf shp.HasTextFrame Then
shp.TextFrame.TextRange.Font.Name = "微软雅黑"
shp.TextFrame.TextRange.Font.NameFarEast = "微软雅黑"
End If
Next
Next
MsgBox "Task completed!"
End Sub
文章来源:https://www.toymoban.com/news/detail-770513.html
到了这里,关于PowerPoint VBA: 一键雅黑——一键将PPT所有内容改为微软雅黑字体的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!