Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Apr 2001
    Location
    Peterborough, Ontario, Canada
    Posts
    1,450
    Thanks
    0
    Thanked 1 Time in 1 Post
    A recent thread brought to mind a question I have about batch conversions, for which it seems there a million hits in search engines. If I have thousands of *.DOC documents, are there any recommendations for converting the lot to *.DOCX documents? I am not worried about losing the formatting in most cases, and I will probably keep the unconverted documents for some time in case I want to see what they look like as originally formatted. Formatting, for better or for worse, will matter in cases such as published material or correspondence, which can be kept in separate folders.


  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by peterg View Post
    If I have thousands of *.DOC documents, are there any recommendations for converting the lot to *.DOCX documents?
    Perhaps there is a service that does this for a price. If I had to do it myself, I might try automating Word 2007. Would I trust a converter other than Word? Hmmm...

  3. #3
    Bronze Lounger
    Join Date
    Apr 2001
    Location
    Peterborough, Ontario, Canada
    Posts
    1,450
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hmmm...indeed.

    Now you have me scratching my head (and heading for the search engines). I thought it was the sort of thing that you might have a ready answer for. The benefit of doing it at all is chiefly to enjoy the benefits (file size etc.) of the newer format and to work toward consistency. The benefit of doing them one at a time is that you know that you have personally inspected each as you did it and it will have a file extension to show that it has been done and to sort on. The benefit of doing them wholesale is that if you have large numbers of them... Hm.

  4. #4
    Bronze Lounger
    Join Date
    Apr 2001
    Location
    Peterborough, Ontario, Canada
    Posts
    1,450
    Thanks
    0
    Thanked 1 Time in 1 Post
    I haven't tried it yet, but here is a LINK that is up to date and that looks like exactly the sort of thing you suggested (and I had in mind). There really are a million hits, but there is no substitute for having someone with the right experience and this looks to be a good source.

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    Quote Originally Posted by peterg View Post
    I haven't tried it yet, but here is a LINK that is up to date and that looks like exactly the sort of thing you suggested (and I had in mind). There really are a million hits, but there is no substitute for having someone with the right experience and this looks to be a good source.
    Taking a quick look at the download documentation for the utility you can get via that link, it's not clear that that tool will actually convert .doc documents to .docx documents. Anyway, here's a quick and dirty utility that should do this - it appears to work OK on my Office 2007/Win XP Pro machine, your mileage may vary.

    You can save the attached template as a global add-in, or alternatively, just open the file and run the macro called "ConvertDocs". Code pasted in below.

    Code:
    Option Explicit
    'Reference set to MS Scripting Runtime
    'Gary Frieder 2010 for Windows Secrets Lounge
    
    Public Sub ConvertDocs()
    
       Dim FSO As New FileSystemObject
       Dim oFolder As Folder
       Dim oFiles As Files
       Dim oFile As File
       Dim TmpFile As File
       Dim FolderPath As String
       Dim TmpFilePath As String
       Dim TmpFileName As String
       Dim TmpDoc As Document
    
       On Error GoTo Handler
       FolderPath = BrowseFolder
       Set oFolder = FSO.GetFolder(FolderPath)
       Set oFiles = oFolder.Files
       'i = 1
       For Each oFile In oFiles
          If LCase$(Right$(oFile.Name, 4)) = ".doc" Then
             Set TmpFile = oFile
             TmpFilePath = TmpFile.Path
             TmpFileName = TmpFile.Name
             TmpFileName = Left$(TmpFileName, Len(TmpFileName) - 4)
    '         Debug.Print TmpFilePath
    '         Debug.Print TmpFileName
             Set TmpDoc = Documents.Open(FileName:=TmpFilePath, Visible:=False)
             TmpDoc.SaveAs FileName:=FolderPath & "\" & TmpFileName, FileFormat:=wdFormatDocumentDefault
             TmpDoc.Close
             'Uncomment the below line of code, to delete the original .doc files:
             'TmpFile.Delete
             Set TmpDoc = Nothing
             Set TmpFile = Nothing
          End If
       Next 'oFile
    
       Set oFiles = Nothing
       Set oFolder = Nothing
       Set FSO = Nothing
       
    Handler:
       'Trap for err 5132 - Open FileConverter missing msg
       If Err.Number = 5132 Then
          Err.Clear
          Resume
       End If
    End Sub
    
    Public Function BrowseFolder(Optional Title As String = "Browse for folder with Docs to convert", Optional RootFolder As Variant) As String
        On Error Resume Next
        BrowseFolder = CreateObject("Shell.Application").BrowseForFolder(0, Title, 0, RootFolder).Items.Item.Path
    End Function
    Gary
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •