我正在使用 Office 2016。我从此处从 Microsoft 网站复制了一些文本。 Microsoft 网站上的代码片段采用灰色背景格式。现在,当我复制此文本并将其粘贴到 Microsoft Word 文档时,我想要复制的文本前景色,并希望在粘贴操作期间删除灰色背景色。有什么办法可以做到这一点吗?
Sub RemoveAll()
With ActiveDocument.Range.Font
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
End With
End Sub