Avatar of Sam OZ
Sam OZ
Flag for Australia asked on

Batch convert .doc to .docx

I have a vault with  folder hierarchy with  different types of documents in it   ( Under Root folder it can have Folder1, Folder2....... Under Folder1 it can have Folder1_1, Folder1_2 ....

I have many .doc files inside the vault .  Because of some issues all the .doc files need to be converted to .docx format ( Word 2013)

Is there a utility to batch convert from .doc to .docx ?  ( The folders may have other types of files in it, like excel or pdf . It need to be left as it is)

I downloaded some BatchDocxConverter . But never worked in Windows 7  
 Other option I have is writing a small utility (Macro or .net) .   But Is there a standard proven free one for this ?
SoftwareMicrosoft Word.NET ProgrammingMicrosoft Applications

Avatar of undefined
Last Comment
AndyAinscow

8/22/2022 - Mon
AndyAinscow

http://docxtodoc.net/download.html

It should work in Win7.  Was there some error or other problem?
Anastasia D. Gavanas

You can do this from the CMD (command prompt) of your windows
Navigate to the path with change directory with dir c:\mypath (substituting C: with the drive and mypath with your folder
then type in ren *.doc *.docx
or
rename *.doc *.docx

and repeat for every subfolder
Anastasia D. Gavanas

You can also use a script to do this:

Option Explicit

Dim objFSO, objFolder, objFile, strNewName, strOldName
Dim strPath, strName

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("c:\test")		  'set your folder
For Each objFile In objFolder.Files
  ' Check if file name ends with ".doc".
  If (Right(LCase(objFile.Name), 4) = ".doc") Then
    ' Rename the file.
    strOldName = objFile.Path
    strPath = objFile.ParentFolder
    strName = objFile.Name
    ' Change name by changing extension to ".docx"
    strName = Left(strName, Len(strName) - 4) & ".docx"
    strNewName = strPath & "\" & strName
    ' Rename the file.
    Wscript.Echo strOldName & " : " & strNewName
'     objFSO.MoveFile strOldName, strNewName
  End If
Next

Open in new window

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Brian B

xtermie, your efforts are appreciated, but I think the person asking the question wants to change the file *format* not just the file *name*. Your answers are simply renaming the files.

Thanks,
Brian (TBone2K)
Topic Advisor
SOLUTION
Anastasia D. Gavanas

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
AndyAinscow

>>I don't think that would be an issue (renaming) between Word documents as it is from .doc to .docx,

I hope you do understand that a .docx is NOT the same format as a .doc document, you can not just rename them.  Also note the asker does explicitly say convert the format.
SOLUTION
Joe Winograd

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Anastasia D. Gavanas

A .docx file is a Microsoft Word XML Format Document file
Off course I understand the difference AndyAinscow, that's why I posted that macro that does just what the author asks.
Opens all .doc in a folder and SaveAs .docx (which converts them).
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
AndyAinscow

>>Off course I understand the difference AndyAinscow
Your first two comments didn't show that at all.  The third started with a sentence implying you thought there was no difference.
Anastasia D. Gavanas

Andy I have a clear understanding of the difference, but from my experience in handling such files, even if you just rename a .doc to .docx there are no issues, as you are going forward to the latest file format and not backwards.  If you tried the opposite there could be problems (convert .docx to .doc).  We have done this with several files (and rather complicated ones) in my organization and have no issues whatsoever.  And anyhow, we are here to help the author of the question solve their issues with our comments. The macro I provided to SaveAs does what the author wants; what is the point of your comments on my understanding of doc types?
ASKER CERTIFIED SOLUTION
Anastasia D. Gavanas

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Sam OZ

ASKER
thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
AndyAinscow

>>what is the point of your comments on my understanding of doc types?

I agree helping the asker with the question is important.  
In addition if an expert attempting to help apparently shows they do not understand the difference between two things is it not important that is corrected.  It could give the asker (or others that look at this question) the impression there is no difference between a .doc and a .docx format.

>>even if you just rename a .doc to .docx there are no issues
I've just create a simple word doc and saved in the .doc format.  I have then renamed it to have the extension .docx

SNAG-0019.bmpThen I attempt to open it and receive the above error, roughly translated: Can't open the file as it is not a docx format