1. 打开包含需将批注转换为脚注或尾注的文档,按下 Alt+F11 组合键,即可打开 Microsoft Visual Basic for Applications 窗口。
2. 在 Microsoft Visual Basic for Applications 窗口中,点击插入 > 模块,然后将以下 VBA 代码复制到模块窗口中。
VBA 代码:将批注转换为脚注:
Sub ConvertCommentsToFootnotes()
Dim xComm As Comment
Dim xCommRange As Range
Dim xDoc As Document
Application.ScreenUpdating = False
Set xDoc = ActiveDocument
For Each xComm In xDoc.Comments
Set xCommRange = xComm.Range
xDoc.Footnotes.Add xComm.Scope, , xCommRange.Text
xComm.Delete
Next
Application.ScreenUpdating = True
End Sub
VBA 代码:将批注转换为尾注:
Sub ConvertCommentsToEndnotes()
Dim xComm As Comment
Dim xCommRange As Range
Dim xDoc As Document
Application.ScreenUpdating = False
Set xDoc = ActiveDocument
For Each xComm In xDoc.Comments
Set xCommRange = xComm.Range
xDoc.Endnotes.Add xComm.Scope, , xCommRange.Text
xComm.Delete
Next
Application.ScreenUpdating = True
End Sub