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