跳到主要內容

如何在Microsoft Word中將註釋轉換為腳註或尾註?

假設您的Word文檔中有多個註釋,如何將所有這些註釋同時轉換為腳註或尾註? 本文提供了VBA方法來實現它。

使用VBA代碼將註釋轉換為腳註或尾註


使用VBA代碼將註釋轉換為腳註或尾註

下面的VBA代碼可以幫助您快速將當前文檔中的所有註釋轉換為腳註或尾註。 請執行以下操作。

1.打開包含要轉換為腳註或尾註的註釋的文檔,然後按 其他 + 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

3。 按 F5 鍵來運行代碼。

然後,根據您應用的VBA代碼,當前文檔中的所有註釋將立即轉換為腳註或尾註。


相關文章:

最佳辦公生產力工具

Kutools for Word - 透過 Over 提升您的文字體驗 100 顯著特點!

🤖 Kutools 人工智慧助手:用人工智慧改變你的寫作 - 生成內容  /  重寫文字  /  總結文件  /  查詢資料 基於文檔,全部在Word中

📘 文件掌握: 分頁  /  合併文件  /  以各種格式匯出選擇(PDF/TXT/DOC/HTML...)  /  批次轉換為PDF  /  將頁面匯出為圖像  /  一次列印多個文件...

內容編輯: 批量查找和替換 跨多個文件  /  調整所有圖片的大小  /  轉置表行和列  /  將表格轉換為文字...

🧹 輕鬆清潔: 移開 多餘的空間  /  分節符  /  所有標題  /  文本框  /  超鏈接  / 如需更多拆卸工具,請前往我們的 刪除組...

創意插入: 插入 千位分隔符  /  複選框  /  單選按鈕  /  QR Code  /  條碼  /  對角線表  /  公式標題  /  圖片說明  /  表格標題  /  多張圖片  / 發現更多 插入組...

🔍 精準選擇:精確定位 特定頁面  /    /  形狀  /  標題段落  / 增強導航功能 更多 選擇功能...

星級增強: 快速導航至任何位置  /  自動插入重複文字  /  在文檔視窗之間無縫切換  /  11 轉換工具...

???? 想嘗試這些功能嗎? Kutools for Word 提供了 60天免費試用,沒有任何限制! 🚀
 
Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This is amazing. Thanks so much!!! really useful.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations