如何将演示文稿中的一种样式替换为另一种样式



我有很多演示文稿,其中展示了代码示例。每一节课都是一门课程中的一节课。

我不是很系统:在一些演示中,我使用menlo风格。在其他情况下,我使用consolas。我有时也会把两者混合在同一个演示中。糟糕,糟糕的我!

我现在想让一切更加一致。在每一次演讲中浏览每一张幻灯片来改变风格是对我的惩罚。

但是,有没有办法使这种变化成为全球性的?我的意思是,有没有一种方法可以在全球范围内取代演讲中的风格?在多个演示中?

这里有一个启动器:

Option Explicit
' Edit these to reflect the names of the fonts
' you want to change from and to:
Const ChangeFromFont As String = "Consolas"
Const ChangeToFont As String = "Courier New"
Sub ChangeFontName()
Dim oSh As Shape
Dim oSl As Slide
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
With oSh.TextFrame.TextRange
If UCase(.Font.Name) = UCase(ChangeFromFont) Then
.Font.Name = ChangeToFont
End If
End With
End If
End If
Next
Next
End Sub

相关内容

最新更新