Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Word document from command line with additional data source parameter

It is possible to open a word document from the command line using this:

rundll32 url.dll,FileProtocolHandler path.to.word.document.doc

Unfortunately, that document needs an external data source, so the path of that data source has to be set manually once it is opened.

Is there a more convenient way to provide an additional parameter to point to the data source?

like image 990
erdal.karaca Avatar asked Aug 31 '25 04:08

erdal.karaca


2 Answers

You can open a word document using

winword.exe <filepath>

To use winword in command prompt you need to set your path variable like this

set path=%path%;C:\Program Files\Microsoft Office\Office14
like image 162
AbhinavRanjan Avatar answered Sep 02 '25 18:09

AbhinavRanjan


In the cmd instance I opened the document but just typing in the document name in

"whatever it's called.docx"

like image 37
Marcus Mapp Avatar answered Sep 02 '25 17:09

Marcus Mapp