首先,你调出任务管理器,把word的全部进程都结束掉。
然后运行下面代码
Dim app As New MSWord.Application
try
app.DisplayAlerts = False
Dim doc1 = app.Documents.Open(ProjectPath & "testword\test1.docx")
app.ActiveWindow.Selection.WholeStory
app.ActiveWindow.Selection.Copy
doc1.saved = True
Doc1.Close
Dim doc2 = app.Documents.Open(ProjectPath & "testword\test2.docx")
app.ActiveWindow.Selection.WholeStory
app.ActiveWindow.Selection.MoveRight(Unit:=1, Count:=1)
app.ActiveWindow.Selection.TypeParagraph
app.ActiveWindow.Selection.Paste
app.Documents.save
doc2.Close
app.quit
catch ex As exception
msgbox(ex.message)
app.quit
End try