加NEW关键字
Dim wordDoc As New Word.Document
Dim WordApp As New Word.Application
就可以了
把Set WordApp = CreateObject("Word.Application")去掉,没用
用Set wordDoc = getobject(App.Path + "\temp.doc")
错误处理
on error resume next 放前面
加一句:worddoc.close
加NEW关键字
Dim wordDoc As New Word.Document
Dim WordApp As New Word.Application