我正在尝试更改PowerPoint中所有超链接的颜色。
这是我的第一次尝试:
Sub ChangeShapeColor()
Dim oHl As Hyperlinks
Dim oSl As Slide
' Look at each slide in the current presentation:
For Each oSl In ActivePresentation.Slides
' Look at each shape on each slide:
For Each oHl In oSl.Shapes
' IF the shape's .Fill.ForeColor.RGB = black color:
If oHl.Fill.ForeColor.RGB = RGB(0, 0, 0) Then
' Change it to corporate yellow:
oHl.Fill.ForeColor.RGB = RGB(242, 235, 26)
End If
Next oHl
Next oSl
End Sub谢谢你帮我!
发布于 2017-12-03 00:08:54
要调整所有超链接颜色,请更改配色方案,特别是方案中控制超链接颜色的第11个和第12个插槽。
下面的示例将超链接和跟随的超链接颜色分别设置为绿色和红色:
Sub SetHyperlinkColors()
With ActivePresentation.Designs(1).SlideMaster.Theme.ThemeColorScheme
' Hyperlink color
.Colors(11).RGB = RGB(0, 255, 0)
' Followed hyperlink color
.Colors(12).RGB = RGB(255, 0, 0)
End With
End Sub这是简化的版本。它只作用于演示文稿中的第一个设计(即Master)。如果你有多个设计,你可以这样做,这也适用于只有一个设计的演示文稿:
Sub SetHyperlinkColors()
Dim x as Long
With ActivePresentation
For x = 1 to .Designs.Count
With .Designs(x).SlideMaster.Theme.ThemeColorScheme
' Hyperlink color
.Colors(11).RGB = RGB(0, 255, 0)
' Followed hyperlink color
.Colors(12).RGB = RGB(255, 0, 0)
End With ' Designs(x)
Next ' Design
End with
End Subhttps://stackoverflow.com/questions/47569921
复制相似问题