Merging from Access to Word Doc

  • Thread starter Thread starter Kathy
  • Start date Start date
K

Kathy

I work on a lan system with many many drives, I can do a
merge from Access to a word document by having the code
open word:

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft
Office\Office\WINWORD.EXE T:\Training & Outreach\Word
Merge Documents\ExhibitorsLetterMerge2.doc"
Call Shell(stAppName, 1)

Last year when I used this, it worked no problem, this
year it's telling me that the "Document Name or Path is
not valid"

I'm not sure why, as I've actually copied the path to
ensure accuracy. Any ideas?
 
Where is the MS Access executable running from? It needs
to be running from a computer that has access to the same
C: drive and network T: drives as before. The person
running the MS Access may have access to both these
directories. But the computer or network where the MS
Access.exe program installed and running from may not.


Kevin11


END
 
Kevin, I'm running it, and I have MS.Access installed on
my computer. everyone who will use this DB has access to
both drives.
 
Hi Kathy,

Since your filespecs contain spaces you need to enclose them in quotes
on the command line. Try:

stAppName = """C:\Program Files\Microsoft Office\Office\WINWORD.EXE""
""T:\Training & Outreach\Word Merge
Documents\ExhibitorsLetterMerge2.doc"""
 
Well, I tried that and it didn't like that either.........
-----Original Message-----
Hi Kathy,

Since your filespecs contain spaces you need to enclose them in quotes
on the command line. Try:

stAppName = """C:\Program Files\Microsoft Office\Office\WINWORD.EXE""
""T:\Training & Outreach\Word Merge
Documents\ExhibitorsLetterMerge2.doc"""

I work on a lan system with many many drives, I can do a
merge from Access to a word document by having the code
open word:

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft
Office\Office\WINWORD.EXE T:\Training & Outreach\Word
Merge Documents\ExhibitorsLetterMerge2.doc"
Call Shell(stAppName, 1)

Last year when I used this, it worked no problem, this
year it's telling me that the "Document Name or Path is
not valid"

I'm not sure why, as I've actually copied the path to
ensure accuracy. Any ideas?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
In that case I suspect that the problem is with the merge document. Does
it work when you double-click it in a My Computer window? Does it work
hen you paste the command string from your VBA code into the Start|Run
dialog (you need to omit the doubled quotes, so it will be
"C:\Program Files\Microsoft Office\Office\WINWORD.EXE" "T:\Training &
Outreach\Word Merge Documents\ExhibitorsLetterMerge2.doc"
)?

Well, I tried that and it didn't like that either.........
-----Original Message-----
Hi Kathy,

Since your filespecs contain spaces you need to enclose them in quotes
on the command line. Try:

stAppName = """C:\Program Files\Microsoft Office\Office\WINWORD.EXE"" ""T:\Training & Outreach\Word Merge Documents\ExhibitorsLetterMerge2.doc"""

I work on a lan system with many many drives, I can do a
merge from Access to a word document by having the code
open word:

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft
Office\Office\WINWORD.EXE T:\Training & Outreach\Word
Merge Documents\ExhibitorsLetterMerge2.doc"
Call Shell(stAppName, 1)

Last year when I used this, it worked no problem, this
year it's telling me that the "Document Name or Path is
not valid"

I'm not sure why, as I've actually copied the path to
ensure accuracy. Any ideas?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top