Solved

Batch convert .doc to .docx

Posted on 2016-08-30
13
100 Views
Last Modified: 2016-09-02
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 ?
0
Comment
Question by:Sam OZ
13 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
http://docxtodoc.net/download.html

It should work in Win7.  Was there some error or other problem?
0
 
LVL 17

Expert Comment

by:xtermie
Comment Utility
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
0
 
LVL 17

Expert Comment

by:xtermie
Comment Utility
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

0
 
LVL 23

Expert Comment

by:Brian B
Comment Utility
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
0
 
LVL 17

Assisted Solution

by:xtermie
xtermie earned 250 total points
Comment Utility
I don't think that would be an issue (renaming) between Word documents as it is from .doc to .docx, and not backwards to worry about compatibility issues.
The renaming should work just fine in this case.

But, anyway...Another way would be to run a macro from word to open all doc files and saving them as docx
Open Word, Hit Alt+F11, copy - paste the macro
type in your folder and then Run the macro
Dim file
Dim path As String
path = "C:\Test\"           'your folder here

file = Dir(path & "*.doc")
Do While file <> ""
Documents.Open FileName:=path & file
ActiveDocument.SaveAs2 FileName:=path & file, FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _
        AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
        EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
        :=False, SaveAsAOCELetter:=False, CompatibilityMode:=15
ActiveDocument.Close
file = Dir()
Loop
End Sub

Open in new window

0
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
>>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.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 51

Assisted Solution

by:Joe Winograd, EE MVE
Joe Winograd, EE MVE earned 250 total points
Comment Utility
I haven't tried it, but the macro here by Graham Mayor looks promising:

http://answers.microsoft.com/en-us/office/forum/office_2007-word/is-it-possible-to-convert-a-batch-of-doc-files-to/8f5549be-8143-4f0a-8f82-06c855fcb092

The version on the first page handles just a single folder. Go to the second page, where Graham posted a version that recurses into subfolders, but note the caveats at the top of the post. Regards, Joe
0
 
LVL 17

Expert Comment

by:xtermie
Comment Utility
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).
0
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
>>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.
0
 
LVL 17

Expert Comment

by:xtermie
Comment Utility
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?
0
 
LVL 17

Accepted Solution

by:
xtermie earned 250 total points
Comment Utility
...and digging around, I found this very helpful blog post which claims to do exactly what the author wants (if they don't want to use my macro)

https://blogs.msdn.microsoft.com/ericwhite/2008/09/18/bulk-convert-doc-to-docx/
0
 

Author Comment

by:Sam OZ
Comment Utility
thanks
0
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
>>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
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now