
In other words, if the original file has macros in it, those macros will be stripped off in the conversion process.įinally, notice that the heart of the macro is contained within an If / Then structure that checks to make sure the rightmost 4 characters of the filename are actually ".doc". Further, you should understand that this converts all the DOC files to DOCX files. For instance, if you ran this macro twice in a row, you would get errors because the files being saved in the target directory already exist. The reason is because it does no error checking on its work. Note that I mentioned this is a simple approach. The macro then steps through all the DOC files it finds in the source directory, opens them, and saves them as DOCX files in the target directory.
Word doc to docx converter full#
Then, in the sTargetPath variable, specify the full path (with trailing backslash) of the directory in which the converted documents should be stored. First, specify in the sSourcePath variable the full path (followed by a backslash) to the directory that contains the files you want to convert. In order to use the macro, you'll need to make two changes. SaveAs FileName:=sTargetPath & sNewDocName, _ SNewDocName = Replace(sDocName, ".doc", ".docx") Set docCurDoc = Documents.Open(FileName:=sSourcePath & sDocName) 'Only work on files where right-most characters are ".doc"

' Repeat as long as there are source files STargetPath = "c:\Users\Administrator\Desktop\Converted\" SSourcePath = "c:\Users\Administrator\Desktop\Testing\"

You can, however, create your own macro to do the conversions.

Microsoft does not provide this functionality in Word, nor do they provide an add-in to do the conversions. He wonders if there is a quick way to convert them without opening and saving each one individually. Christian has a folder full of DOC files that he needs to convert to DOCX files.
