Solved CMD BAT write/echo into ms word file

June 30, 2013 at 06:04:01
Specs: Windows XP, 4 Gigs
Hello all,
I hope somebody can help.

Instead of writing results from a CMD Query into a Text or CSV File, I want to Write it into a MS Word File.

2 challenges here:

1. How to specify Format (Font, Size etc..) via CMD

2. Once I insert values into the word file via CMD, Word will ask for the propper coding upon opening the created file. If I don't select manually "Windows standart" it won't open.

Any Ideas?

Thanks in advance!

See More: CMD BAT write/echo into ms word file

Report •

June 30, 2013 at 19:37:01
✔ Best Answer
You can't, using batch/CMD. All you can accomplish with batch is to put text into Word. You can't even save it, since Word is GUI-based and not oriented to commandline control. Your only option is to use a more sophisticated interface to access the Word object (vbscript, powershell, hta, vis-basic, etc). That will let you change fonts, save-as, or anything else you want to do. (I have no idea what #2, in your post, means - password-protection?)

Report •
Related Solutions

Ask Question