Blog - Title

Bulk Convert DOC to DOCX

Bulk Convert DOC to DOCX

  • Comments 31

Microsoft has a bulk conversion utility that can convert multiple DOC files to DOCX files.  This blog post presents very basic information on its use.  This utility has been around for a while, but a fair number of people don’t know of its existence.  Because it’s a powerful tool designed to convert all files on a server (or even a bunch of servers), its use is a little cryptic.  This is fine for IT professionals, but if all you want to do is bulk convert a single directory of DOC files, this post shows what you need to do.

This blog is inactive.
New blog: EricWhite.com/blog

Blog TOC
Before you can use this tool, you need to install the Microsoft Office Compatibility Pack.  While the compatibility pack is primarily used with Office 2003 to allow it to load and save Open XML files, in essence, the compatibility pack is comprised of file format converters, which the Office File Converter (OFC) uses.  To use OFC, you need to install the compatibility pack even if you only have Office 2007 installed.  Download the compatibility pack here.

Next, you need to download and install the Microsoft Office Migration Planning Manager (OMPM).  This contains a bunch of stuff, but for bulk file conversion, we are primarily interested in just one tool, OFC.EXE.  Download the Microsoft Office Migration Planning Manager here.

When installing, as usual, you will select the installation directory.  OFC.EXE is in the Tools directory under the installation directory.  In addition, in that directory, there is a sample OFC.INI file.  To run OFC.EXE, you need to create an OFC.INI, and place it in the directory where you run OFC.EXE from.

For my simple example, I want to convert all DOC files found in the C:\Users\ericwhit\Documents\08-09-19-Doc, and place the converted DOCX files in C:\Users\ericwhit\Documents\08-09-19-Docx.  Here is the OFC.INI file for this scenario:

[Run]
LogDestinationPath=C:\Users\ericwhit\Documents\08-09-19-Conversion-Log\
TimeOut = 3
 
[ConversionOptions]
; FullUpgradeOnOpen: if set to 1, Word documents will be fully converted to the OpenXML format
;                    if set to 0 (default), Word documents will be saved in the OpenXML format in compatibility mode
FullUpgradeOnOpen=1
 
CABLogs=0
 
MacroControl=0
 
[FoldersToConvert]
fldr=C:\Users\ericwhit\Documents\08-09-19-Doc\
 
[ConversionInfo]
SourcePathTemplate=*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\
DestinationPathTemplate=C:\Users\ericwhit\Documents\08-09-19-Docx\
 

The SourcePathTemplate and DestinationPathTemplate provide extremely flexible configuration for bulk conversion of a large number of directories.  They allow an IT professional to, say, convert files from one entire server, place the converted files on a different server, and use various sub-paths of the path of the source document to form the path where the DOCX will be placed.  Fully configuring SourcePathTemplate and DestinationPathTemplate is beyond the scope of this blog post.  The configuration above basically specifies to just take all of the DOC files in the specified fldr directory, and place them in the specified DestinationPathTemplate directory.

So, place a modified version of the above INI file in some directory, and run OFC.EXE from that directory.  You will see something like this:

 Your newly created DOCX files will be in the directory you specified in DestinationPathTemplate.

Leave a Comment
  • Please add 1 and 8 and type the answer here:
  • Post
  • Voici les quelques liens techniques intéressants autour de Open XML de cette dernière semaine : Créer

  • Voici les quelques liens techniques intéressants autour de Open XML de cette dernière semaine : Créer

  • Thanks for posting this, very big time saver.  I was wondering if there is a simple command to put in the INI file to do a folder and all of it's subfolders

  • If you want to make sure that files in all subfolders are also dealt with, use the ConvertSubFolders setting.

    For example, add the following line to the [FoldersToConvert] section:

    ConvertSubFolders=1

  • I was wondering if this could be used to convert from DOCX to just DOC?

    Thanks,

    Callum

  • Hi Callum,

    This utility only converts from DOC to DOCX.

    -Eric

  • This creates duplicate copies in the new format, it does not convert in the sense of the word. what most people need is to convert the doc file to docx, not to make another copy in a different location. How can you tell this tool to remove the old doc files after it's created the new docx files?

  • Hi Leo, yes, it's true that OFC.EXE only converts files, and doesn't remove old ones.  To implement something like this is pretty easy using PowerShell.

    -Eric

  • I'm not familiar wih using that, has anyone got something already that I could use or toy with?

  • A few months ago I thought of this. I wanted an explorer add-in that would allow me to right click...

  • Why not have a built in way for it to clean up after a successful conversion?  We have hundreds of thousands of files to convert and do not want to create duplicates.  We want to benefit from the reduced file size to shrink our file storage needs.  Powershell is not much of a solution, if I didn't like GUI's, I would switch to Unix!

  • Hi Robert,

    I don't know the reasoning of the dev team, but I would guess that it's because removing documents gets into the whole area of document retention policies - who can delete which documents - what about documents that are owned by someone who doesn't want them deleted, etc.  This is an extremely complicated issue, and adding functionality into a document conversion tool that encroaches on the issues of document retention would really complicate the tool.

    One approach - you can configure OFC.INI to convert documents and place the new documents in a parallel directory structure.  You can then delete the original directory structure with a single command, which reduces your burden significantly.

    -Eric

  • I can see your point, but can you imagine moving 1500 users cheese on them?  I have thought about converting one home directory at a time, putting all the converted docs in one place, and then moving them back.  Can you see where I am going here?  

    Anyway, I guess after about 10 or so years, all the old docs and spreadsheets will be gone.

    I just wish a tool could be developed to make this task feasible for large amounts of files so the end users do not feel the pain.  I guess until something third party comes out since Microsoft evidently has no intentions of doing it, we will not benefit from the XML format except in newly created files.

  • Actually you don't need the ofc just the compatibility pack. You can use the commandline (good for batch scripting/ powershell for those looking for a different behaviour than the ofc offers):

    "C:\Program Files\Microsoft Office\Office12\wordconv.exe" -oice -nme <input file> <output file>

  • I have converted the file doc to docx format. But I could find that the Document variables in the file has got corrupted. And also, I have tried the convert in the Office Menu Button.

Page 1 of 3 (31 items) 123