问题
I would like to highlight the selected text into a colour but this is not working. Could you help me with that ?
Sub ShadingLtYellow()
ActiveWindow.Selection.TextRange.HighlightColor.RGB = RGB(255, 255, 175)
End Sub
Also can I trigger the macro using the a keyboard shortcut such as application onkeys on Excel ?
This would be great
回答1:
TextRange is for backward compatibility with older versions of PowerPoint. With current versions (2010 and later), use the Textrange2 object instead, it has Highlight:
ActiveWindow.Selection.TextRange2.Font.Highlight.RGB = RGB(255, 255, 175)
来源:https://stackoverflow.com/questions/58175015/vba-powerpoint-how-to-highlight-selected-text