S
Simon Verona
I have a problem with automating MS Word through vb.net
My code is :
Dim objword As new Word.ApplicationClass
Try
objWord.Documents.Open(letterfile)
objWord.Documents.Item(letterfile).Activate()
Catch
MsgBox("Error - Word Not running properly - letterfile=" & letterfile &
vbCrLf & " Error = " & Err.Description)
openletter = True
Exit Function
End Try
This works fine on my development machine with Word XP installed. However,
when installed on another PC (with Word 2000 installed) it fails with an
error "Object reference not set to an instance of an object". I can tell
from the task manager that Word has started up and is running but beyond
that I can't work out what the problem is. I have distributed the
application simply by using the Windows installer project which seems to
distribute an interop.word library.
I don't know what else to try.... I'm presuming that as I have Word XP on
my development machine that any word code should be backwardly compatible.
Any thoughts?
Regards
Simon
My code is :
Dim objword As new Word.ApplicationClass
Try
objWord.Documents.Open(letterfile)
objWord.Documents.Item(letterfile).Activate()
Catch
MsgBox("Error - Word Not running properly - letterfile=" & letterfile &
vbCrLf & " Error = " & Err.Description)
openletter = True
Exit Function
End Try
This works fine on my development machine with Word XP installed. However,
when installed on another PC (with Word 2000 installed) it fails with an
error "Object reference not set to an instance of an object". I can tell
from the task manager that Word has started up and is running but beyond
that I can't work out what the problem is. I have distributed the
application simply by using the Windows installer project which seems to
distribute an interop.word library.
I don't know what else to try.... I'm presuming that as I have Word XP on
my development machine that any word code should be backwardly compatible.
Any thoughts?
Regards
Simon