|
可以试试如下宏代码处理- Sub test()
- Dim i As Integer
- Dim TF As Boolean
- Dim curDoc As Document
- Dim aField As Field
- Dim fieldtext As String
-
- Application.ScreenUpdating = False
- Set curDoc = ActiveDocument
- TF = ActiveDocument.ActiveWindow.View.ShowFieldCodes
- If TF = False Then ActiveDocument.ActiveWindow.View.ShowFieldCodes = True
- For Each aField In Documents.Add(curDoc.FullName).Content.Fields
- If aField.Type = wdFieldFormula Then
- aField.Select
- fieldtext = Replace(Selection.Text, Chr(19), "{")
- fieldtext = Replace(fieldtext, Chr(21), "}")
- aField.Result.InsertAfter fieldtext
- aField.Delete
- i = i + 1
- End If
- Next
- MsgBox "共处理了" & i & "个EQ域。处理结果见新文档"
- ActiveDocument.ActiveWindow.View.ShowFieldCodes = TF '恢复原来的文档域代码显示设置
- curDoc.ActiveDocument.ActiveWindow.View.ShowFieldCodes = TF
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|