h1

Word: Batch convert old DOC documents to DOCX

November 22, 2020

I was going through some folders and found quite a number of Word files in DOC format that I created before I started using Word 2007, which was when the DOCX format was introduced. While I can open each and save it as DOCX, that becomes very tedious if you have more than a few to do. Off to the internet to see if there was a macro or other way of batch converting DOC files to DOCX files.

The two that offered the most promise were a macro from the makers of Kutools (https://www.extendoffice.com/documents/word/5601-word-batch-convert-doc-to-docx.html) and a converter program (http://www.multidoc-converter.com/en/index.html). I thought I’d try the macro first, and as it worked fine for what I wanted, I didn’t download and test the converter program.

Notes about the macro:

  • When testing, put the DOC files into a temporary folder and run the macro on that folder. You can copy the resulting DOCX files to the correct folder later. Once you are confident it works as expected, you could run the macro on the original folder.
  • Subfolders are ignored. The macro only works on the selected folder.
  • All the DOC files are opened briefly, then saved as DOCX, without your intervention. Let the macro run until it finishes.
  • All the new DOCX files will have the current date as the date of creation. All original date creation and modification information will be lost, and also possibly original author information (I didn’t check this).
  • If there are already DOCX files of the same name in the folder, this process will overwrite them automatically. This isn’t usually an issue, but if at some point you manually saved a DOC file as DOCX, then modified it, the converted DOCX file will overwrite that modified file. This is why it’s advisable to do these conversions in a separate folder to the original, then copy back once done.
  • If some of the DOC files are quite old, you may get a message that it cannot save Word 95 binary files (or similar), and the macro will not run. To include these documents in the conversion, got to File > Options in Word, then select Trust Center. Click Trust Center Settings, then go to File Block Settings. Uncheck the boxes for relevant file types that the macro got hung up on. Don’t forget to change this back later!

And in case that macro ever goes missing from the website linked above, I’ve pasted it here, with some additional comments. If you use this one, copy it all—do not retype it as several lines go off the page:

Sub ConvertDocToDocx()
' Opens all DOC files in a folder and saves as DOCX files
' Asks for the folder location of the DOC files when you run the macro
' If DOCX files of the same name exist in the folder, it will overwrite them
' Recommendation: Put DOC files into a separate folder and run there
' NOTE: Converted files will have today's date---original file date is lost forever

' From: by ExtendOffice 20181128
' From (22 Nov 2020): https://www.extendoffice.com/documents/word/5601-word-batch-convert-doc-to-docx.html

    Dim xDlg As FileDialog
    Dim xFolder As Variant
    Dim xFileName As String
    Application.ScreenUpdating = False
    Set xDlg = Application.FileDialog(msoFileDialogFolderPicker)
    If xDlg.Show <> -1 Then Exit Sub
    xFolder = xDlg.SelectedItems(1) + "\"
    xFileName = Dir(xFolder & "*.doc", vbNormal)
    While xFileName <> ""
        Documents.Open FileName:=xFolder & xFileName, _
            ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
            PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
            WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
            wdOpenFormatAuto, XMLTransform:=""
        ActiveDocument.SaveAs xFolder & Replace(xFileName, "doc", "docx"), wdFormatDocumentDefault
        ActiveDocument.Close
        xFileName = Dir()
    Wend
    Application.ScreenUpdating = True
End Sub

[Links last checked 22 November 2020]

 

One comment

  1. Thanks for sharing. Eventually I had to use this tool: https://freetools.site/document-converters/doc-to-docx



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: