How can I open a Word file from Access with a macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that has a file in word that is assocaited with the database.

How can I open the word file with a macro in Acesss.

Thanks
 
Hello Michael.

Michael O said:
I have a database that has a file in word that is assocaited with the
database.
How can I open the word file with a macro in Acesss.

Use the RunApplication action, and as commandline argument, use
"PathToWinword.exe" "PathToDocument.doc"
Here, "PathToWinword.exe" is the complete path and filename of
Microsoft Word, for example
"C:\Program Files\Mocrosoft Office\Office11\Winword.exe"
and "PathToDocument.doc" is the complete path and filename of the
document you want to open.
 
Hi Wofgang

The path to winword works fine. Thank you.

The path to my document doesn't work.
It's H:\0mof\copiers\copier readings instructions.doc

How does this follow on from the path to winword?

Cheers
 
You might want to try to use the UNC path if it's on a server or something

Example: \\SERVERNAME\SHARENAME\0mof\copiers\copier readings instructions.doc

Michael said:
Hi Wofgang

The path to winword works fine. Thank you.

The path to my document doesn't work.
It's H:\0mof\copiers\copier readings instructions.doc

How does this follow on from the path to winword?

Cheers
Hello Michael.
[quoted text clipped - 9 lines]
and "PathToDocument.doc" is the complete path and filename of the
document you want to open.
 
Michael,

Are you enclosing it is ""s? Should be like this...
"C:\Program Files\whatever\winword.exe" "H:\0mof\copiers\copier readings
instructions.doc"
 
Hello Michael.

The path to winword works fine. Thank you.

The path to my document doesn't work.
It's H:\0mof\copiers\copier readings instructions.doc

How does this follow on from the path to winword?

Since the path to the document contains a space, it must be enclosed
in quotation marks: "H:\0mof\copiers\copier readings instructions.doc"
Otherwise, Winword would interprete the parameter as three separate
values: "H:\0mof\copiers\copier", "readings" and "instructions.doc"
 
Back
Top