1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Converting Files to Word 2003 with a Macro

Discussion in 'Business Applications' started by cweinhofer, Jul 5, 2010.

Thread Status:
Not open for further replies.
  1. cweinhofer

    cweinhofer Thread Starter

    Joined:
    Jul 5, 2010
    Messages:
    2
    I have a folder full of files that I want to convert from Word 07-10 (*.docx) format to Word 97-03 (*.doc) format so I can copy them to an old PDA and view them from there. In the absence of finding a good converter (there aren't a lot of people wanting to go backwards), I have been trying to use a Macro. I found some code on a previous post in this forum and tried to modify it using some code I recorded in Word, but it keeps giving me errors or otherwise does nothing at all. Any suggestions or corrections would he great. I think only the first two peramaters under "SaveAs2" are necessary for my purposes (FileName & FileFormat) but I let the others for the recording in in case Word needed them.

     
  2. JohnWilson

    JohnWilson

    Joined:
    Nov 22, 2007
    Messages:
    262
    You are trying to save with the name something.docx

    Try stripping the Docx and adding Doc

    vsavename = Left$(vfile, Len(vfile) - 4) & "Doc"

    Sub SaveAs03()
    'my folders are on the desktop
    vDirectory = Environ("USERPROFILE") & "\Desktop\FolderA\"
    vfile = Dir(vDirectory & "\" & "*.*")
    Do While vfile <> ""
    'MsgBox vfile
    Documents.Open FileName:=vDirectory & "\" & vfile
    ChangeFileOpenDirectory Environ("USERPROFILE") & "\Desktop\FolderB\"
    vsavename = Left$(vfile, Len(vfile) - 4) & "Doc"
    ActiveDocument.SaveAs2 FileName:=vsavename, FileFormat:=wdDocument
    ActiveWindow.Close
    vfile = Dir
    Loop
    End Sub
     
  3. cweinhofer

    cweinhofer Thread Starter

    Joined:
    Jul 5, 2010
    Messages:
    2
    Wow, the power of a little code. Everything works great! Thanks for helping me turn a 2 hr job into a 5 min one.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/933675

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice