Changing (alternating) the colors of sentences (not highlights)

问题描述 投票:0回答:1
我正在寻找一个vba单词宏,该宏与文本的每个句子分配了不同的颜色。这可以由三种或四种不同的颜色组成。我希望它本身为字体上色。换句话说,我不希望文本突出显示。 我已经研究了这个主题。我发现的唯一宏就是那些突出的宏(我之前已经问了这个问题。

您应该能够对此进行修改,以获取自己想要的方式。

Sub ChangeSentenceColors() Dim sentence As Range Dim randColor As Long For Each sentence In ActiveDocument.Sentences randColor = RGB(Int((255 - 0 + 1) * Rnd + 0), _ Int((255 - 0 + 1) * Rnd + 0), _ Int((255 - 0 + 1) * Rnd + 0)) sentence.Font.Color = randColor Next End Sub

vba colors ms-word
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.