版主:
下述语句在开发版中运行时,不显示Word文件,但在编译后,运行编译版本,就进入了word,一开始显示出内容,后来就不显示内容,但并没有退出word文件。不知道为什么?
Dim app As New MSWord.Application
try
Dim doc1 = app.Documents.Open(ProjectPath & "testword\test1.docx")
app.ActiveWindow.Selection.WholeStory
app.ActiveWindow.Selection.Copy
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
' app.visible = True
doc2.Close
catch ex As exception
msgbox(ex.message)
app.quit
finally