我正在尝试使用域代码http://office.microsoft.com/en-us/word-help/field-codes-ref-field-HP005186139.aspx查找并替换其中的括号和文本
Sub replacereftag()
ReplacementText "<test>", "REF Test.Test1 "
End Sub
Private Sub ReplacementText(findtext As String, replacetext As String)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = findtext
.myrange.Field = replacetext
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub