[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Batch convert .doc to .docx

Posted on 2016-08-30
13
Medium Priority
?
3,068 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 45

Expert Comment

by:AndyAinscow
ID: 41776445
http://docxtodoc.net/download.html

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

Expert Comment

by:xtermie
ID: 41776458
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 18

Expert Comment

by:xtermie
ID: 41776507
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 25

Expert Comment

by:Brian B
ID: 41776528
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 18

Assisted Solution

by:xtermie
xtermie earned 1000 total points
ID: 41776557
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 45

Expert Comment

by:AndyAinscow
ID: 41776720
>>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
 
LVL 57

Assisted Solution

by:Joe Winograd, EE MVE 2015&2016
Joe Winograd, EE MVE 2015&2016 earned 1000 total points
ID: 41777542
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 18

Expert Comment

by:xtermie
ID: 41777648
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 45

Expert Comment

by:AndyAinscow
ID: 41777765
>>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 18

Expert Comment

by:xtermie
ID: 41777813
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 18

Accepted Solution

by:
xtermie earned 1000 total points
ID: 41777816
...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
ID: 41781091
thanks
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 41781114
>>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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
While Plesk offers many potential benefits to website administrators, including compatibility with Windows Server and other leading technologies, the company has also been working to differentiate it from other control panels for content management…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

831 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