s******t 发帖数: 100 | 1 我想find and replace某种颜色的文字,但是Powerpoint好像不直接提供这种功能。
我的原始文件有一部分黄色的文字,我想改成蓝色,其余的保持黑色。
我在网上搜索到一个例子,但是这是改变整个文件字体的颜色,入骨哦我想选择性的改
变某种颜色的字,该如和修改。我是计算机盲,逐个改,很花时间。
谢谢大家!
Sub ChangeFontColor()
' This will change the color of all PowerPoint text to the color you specify
in RGB below
' It won't affect text in charts, pasted graphics, groups, etc.
Dim R As Integer
Dim G As Integer
Dim B As Integer
R = 0
G = 121
B = 193
Dim oSld As Slide
Dim oShp As Shape
Dim oShapes As Shapes
For Each oSld In ActivePresentation.Slides
Set oShapes = oSld.Shapes
For Each oShp In oShapes
If oShp.HasTextFrame Then
If oShp.TextFrame.HasText Then
oShp.TextFrame.TextRange.Font.Color.RGB = RGB(R, G, B)
End If
End If
Next oShp
Next oSld
End Sub |
|