"RunApp winword.exe /t " Returns corrupt file error

T

T Payne

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
 
J

John Nurick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top