批量合并word文档
1、新建一个WORD文档,命名后保存到和要合并的1000多篇文档一个文件夹里。
2、按ALT+F11进入宏编辑器。
3、双击左上角的ThisDocument,在右侧的代码区粘贴代码如下:
Sub 合并文档()
Application.ScreenUpdating = False
MyPath = ActiveDocument.Path
MyName = Dir(MyPath & "\" & "*.doc")
i = 0
Do While MyName <> ""
If MyName <> ActiveDocument.Name Then
Set wb = Documents.Open(MyPath & "\" & MyName)
Selection.WholeStory
Selection.Copy
Windows(1).Activate
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Selection.Paste
i = i + 1
wb.Close False
End If
MyName = Dir
Loop
Application.ScreenUpdating = True
End Sub
4、按F5运行,等候几分钟,即可完成合并
努力奋斗的小墨鱼 ---- http://www.cnblogs.com/WayneZeng/