【发布时间】:2019-06-26 03:25:22
【问题描述】:
我想用 VBA 的超级脚本版本替换所有出现的表达式“\^[0-9]{1,2}”。我已经设法替换了一些私人案例,如下面的代码所示。但是我仍然需要一个基于正则表达式的通用形式。
' replace ^1
Dim table As table
For Each table In ActiveDocument.Tables
With table.Range.Find
.ClearFormatting
.Text = "^^1"
With .Replacement
.ClearFormatting
.Font.Superscript = wdToggle
.Text = "1"
End With
.Execute Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue
End With
Next table
End Sub
【问题讨论】:
标签: vba replace ms-word wildcard