I'm trying to launch Word from a macro using the RunApp action. The command
line I use works perfectly from the start|run menu, but the same command
line returns an error when the Access macro is run. The line is:
C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE
/t..\..\..\CoverLetter.dot
When the macro is run, Word launches, but returns a "file corrupt . . "
message. I know the file is not corrupt. I know it is in the right
directory. Any thoughts on why this may be happening?
T
Make sure you use quote marks to delimit any "chunk" of the command line
that might include a space, e.g.
Dim strCmd As String
strCmd = """C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"" \t
""D:\Folder\Sub Folder\CoverLetter.dot"""
Also, if you are using
/t..\..\..\CoverLetter.dot
to indicate a relative path, you need to take steps to ensure that
Access's idea of the current directory correspondes with yours.
>I'm trying to launch Word from a macro using the RunApp action. The command
>line I use works perfectly from the start|run menu, but the same command
[quoted text clipped - 8 lines]
>
>T
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.