S
simon
i need to opn a mailmerged doc from with Access vba. I have found 2
ways of doing this,
Firstly, i can use the SHELL command but it doesnt like the directory
structure and i cannot get arround this.....
Shell ("c:\program files\microsoft office\office11\winword.exe S:
\Quarles Support Unit\QSU Databases\Simon\new.doc") It opens
winword.exe but has an issue with the long file names & spaces with
the acual document
The other way is to open it with code, but when i do this the
mailmergetoolbar is greyed out. Now, i am sure i have thecode
wrong........
Dim oApp As Object
Dim pos As Integer
Dim filename As String
pos = InStrRev(CurrentDb.Name, "\")
'filename = "S:\Quarles Support Unit\QSU Databases\simon\new.doc"
Set oApp = CreateObject("word.application")
oApp.Visible = True
Set objWord = CreateObject("word.basic")
objWord.fileopen filename
Please please please can someone end my suffering here? it is causing
a real headache. Maybe there is a different way altogether t do this?
Many thanks in advance
ways of doing this,
Firstly, i can use the SHELL command but it doesnt like the directory
structure and i cannot get arround this.....
Shell ("c:\program files\microsoft office\office11\winword.exe S:
\Quarles Support Unit\QSU Databases\Simon\new.doc") It opens
winword.exe but has an issue with the long file names & spaces with
the acual document
The other way is to open it with code, but when i do this the
mailmergetoolbar is greyed out. Now, i am sure i have thecode
wrong........
Dim oApp As Object
Dim pos As Integer
Dim filename As String
pos = InStrRev(CurrentDb.Name, "\")
'filename = "S:\Quarles Support Unit\QSU Databases\simon\new.doc"
Set oApp = CreateObject("word.application")
oApp.Visible = True
Set objWord = CreateObject("word.basic")
objWord.fileopen filename
Please please please can someone end my suffering here? it is causing
a real headache. Maybe there is a different way altogether t do this?
Many thanks in advance