mrchinchin25
IS-IT--Management
Hi,
I'm trying to develop some VB code to open a Word Document from an Access Form. I did a search on EE and found the following code:
Dim doc As Word.Document, wrdApp As Word.Application
On Error Resume Next
Set wrdApp = GetObject(, "word.application"
If Err.Number <> 0 Then
Set wrdApp = CreateObject("word.application"
End If
wrdApp.Visible = True
Set doc = wrdApp.Documents.open("mydoc.doc"
Where it says "word.application" i've entered the path to my winword.exe file (eg. c:/bla/bla/bla/winword.exe)
Where it says "mydoc.doc" i've put in the path to my file.
The code doesn't do anything, it doesn't open word at all.
Can anyone help?
I'm trying to develop some VB code to open a Word Document from an Access Form. I did a search on EE and found the following code:
Dim doc As Word.Document, wrdApp As Word.Application
On Error Resume Next
Set wrdApp = GetObject(, "word.application"
If Err.Number <> 0 Then
Set wrdApp = CreateObject("word.application"
End If
wrdApp.Visible = True
Set doc = wrdApp.Documents.open("mydoc.doc"
Where it says "word.application" i've entered the path to my winword.exe file (eg. c:/bla/bla/bla/winword.exe)
Where it says "mydoc.doc" i've put in the path to my file.
The code doesn't do anything, it doesn't open word at all.
Can anyone help?