不知道为什么计组老师的大量课件字体是伤害视力的亮蓝色……看久了眼睛疼,想把颜色替换成保护视力一点的灰色,但是找了N久也没找到在图形界面上直接操作的方法,于是在MSDN上晃了晃,Google了一下,写了个VBA小脚本,只替换选定颜色,这样可以保留红色或者其他颜色的高亮,顺便把让人分心的花花背景也干掉。 Sub ReplaceColor() Dim shape As shape Dim slide As slide Dim txt As TextRange On Error Resume Next
'替换背景颜色为白色 ActivePresentation.SlideMaster.Background.Fill.Solid ActivePresentation.SlideMaster.Background.Fill.ForeColor.RGB
= RGB(255, 255, 255)
For Each slide In
ActivePresentation.Slides For Each shape In
slide.Shapes Set txt = shape.TextFrame.TextRange For Each sentence In
txt.Sentences
For Each word In
sentence.Words
'把蓝色的文字替换成灰色
If word.Font.color.RGB = RGB(0, 0, 204) Or word.Font.color.RGB = RGB(0, 0, 122) Then
With word.Font
.color.RGB = RGB(40, 40, 40)
End With
End If
Next Next Next Next End Sub
|
|
来自: whuhujiming > 《信息服务于用户》