0
我使用了400多页的编码手册,不幸的是关闭了手册中所有注释的绿色。我无法撤销它,因为直到为时已晚,我才注意到它。它毁了多年的工作。如何在Word 2016中将VBA写入以//开头的格式?
我该如何编写VBA来解析文档查找以//开头的句子,并以段落标记结尾并更改它们的颜色?或者给他们分配一个风格?
这里是我所拼凑起来,我很佩服谁可以写代码,而无需intellisence,它就像试图找到自己的方式的人开始蒙住
Dim oPara As Word.Paragraph
Dim rng As Range
Dim text As String
For Each oPara In ActiveDocument.Paragraphs
If Len(oPara.Range.text) > 1 Then
Set rng = ActiveDocument.Range(oPara.Range.Start,oPara.Range.End)
With rng.Font
.Font.Color = wdColorBlue
End With
End If
Next
End Sub