轻松将多个Word文档合并为一个文件
在日常办公中,经常需要将两个或多个Word文档合并成一个。本文详细介绍多种安全、高效的合并方法,无需额外软件也能轻松完成。
步骤:
适合没有安装Office或需要批量处理的用户:
适用于需要合并多个文档的专业用户:
Sub MergeWordDocuments()
    Dim docMain As Document, docToInsert As Document
    Set docMain = ActiveDocument
    With Application.FileDialog(msoFileDialogFilePicker)
        .Title = "选择要合并的Word文档"
        .Filters.Add "Word Files", "*.docx"
        If .Show = -1 Then
            For Each vrtSelectedItem In .SelectedItems
                Set docToInsert = Documents.Open(vrtSelectedItem)
                docMain.Range.InsertAfter vbCrLf
                docMain.Range.Characters.Last.FormattedText = docToInsert.Content
                docToInsert.Close False
            Next
        End If
    End With
End Sub
        
        运行此宏后,可一次性选择多个Word文件自动合并。
Q:合并后格式错乱怎么办?
        A:建议使用“插入文件中的文字”功能,或粘贴时选择“只保留文本”再重新排版。
Q:能否合并带密码的Word文档?
        A:不能。必须先解除密码保护才能合并。
Q:支持.doc和.docx混合合并吗?
        A:可以,Word会自动兼容两种格式。