开发者

How to save a document in ms word 2003 using command prompt?

开发者 https://www.devze.com 2022-12-15 23:27 出处:网络
Please help, How to save a document in ms word 2003 using command prompt? The only thing I know about cmd is 开发者_如何学Cmaking a directory(mkdir), open ms word(win word), and hide rar files to jpeg

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


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号