03-03-2017, 09:42 PM
I checked some of the information on the Internet, the word macro command can be resolved, as the following code, but I can not write part of the regular expression :oops:
Can I use QM to achieve the following functions?
Sub HighlightColor()
Dim mt, n&, m&, reg As Object
Set reg = CreateObject("vbscript.regexp")
reg.Global = True: reg.MultiLine = True
reg.Pattern = "(????????????????????????)"
For Each mt In reg.Execute(ActiveDocument.Content)
m = mt.FirstIndex: n = mt.Length
With ActiveDocument.Range(m, m + n)
.HighlightColorIndex = wdYellow
End With
Next
End Sub
Can I use QM to achieve the following functions?
Sub HighlightColor()
Dim mt, n&, m&, reg As Object
Set reg = CreateObject("vbscript.regexp")
reg.Global = True: reg.MultiLine = True
reg.Pattern = "(????????????????????????)"
For Each mt In reg.Execute(ActiveDocument.Content)
m = mt.FirstIndex: n = mt.Length
With ActiveDocument.Range(m, m + n)
.HighlightColorIndex = wdYellow
End With
Next
End Sub
