views:

77

answers:

2

Please help, How to save a document in ms word 2003 using command prompt? The only thing I know about cmd is making a directory(mkdir), open ms word(win word), and hide rar files to jpeg files. And moving files from 1 directory to another.

A: 

You can open Word document from the command prompt (starting a new Word process), but there is no easy way of sending any commands to a runnning instance of Word by a simple command line script. If you want to save Word documents programmatically, you can, for example, use VBA ("macros") or VBScript for it. But it would make much more sense if you change the Word document programmatically before, so I suggest that you first make yourself comfortable with VBA.

Doc Brown
A: 

AFAIK there's no direct way to send a command from command line to words UI. You have to imploy a tool or trick here:

Using an autostart macro was sufficient if you want to convert data like opening a txt or html file with the command line and save it as a doc file with the autostart macro. It may even work to shut word down again within that autostart macro. Another possibility is a kind of Win-GUI-recorder like AutoIT. This can create scripts or exes containing a script that record some actions you have previously shown it yourself (and much much more). Take a look at their pages at http://www.autoitscript.com/autoit3/. And a third possibility is Word's ActiveX-IF that can be acessed by any programming system (even AutoIT).

Greetings from Germany!

LuI

LuI