I have a bunch of .doc files in a folder which I need to convert to .docx.
To manually convert the .doc to .docx is pretty simple:
However, doing this for hundreds of files definitely ain't fun. =p
How would you automate this?
There is no need to automate Word, which is rather slow and brittle due to pop-up messages, or to use Microsoft's Office File Converter (ofc.exe), which has an unnecessarily complicated user interface.
The simplest and fastest way would be to install either Office 2007 or download and install the Compatibility Pack from Microsoft (if not already done). Then you can convert from .doc to .docx easily using the following command:
"C:\Program Files\Microsoft Office\Office12\wordconv.exe" -oice -nme <input file> <output file>
where <input file> and <output file> need to be fully qualified path names.
The command can be easily applied to multiple documents using for
:
for %F in (*.doc) do "C:\Program Files\Microsoft Office\Office12\wordconv.exe" -oice -nme "%F" "%Fx"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With