Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Mar 2003
    Elkins Park, Pennsylvania, USA
    Thanked 0 Times in 0 Posts
    Hi. I'm hoping someone has a quick insight into my problem.

    I have legacy documents in Word 2003 DOC format. These documents are forms, protected for fill-in only. (Are you with me so far?) There are no macros, but there are pick-lists. I simply want to convert the documents to the new DOCX (?) format, but it isn't nearly as straightforward as I thought.

    Using this (simplified) code, I can save them with a DOCX extension, but it obviously isn't a true 2007 document; when I try to open it, Word fails with a "Word experienced an error trying to open this file..." message and it won't open.
    strNewFilename = "newfile.docx"
    ActiveDocument.SaveAs FileName:=strNewFilename, FileFormat:=wdFormatDocument
    When I manually use Save As... and select DOCX as the format, I receive the normal you're-about-to-change-the-format prompt, but I then get the message "The following cannot be saved in a macro-free document: VBA Project" and I'm told to choose a macro-enabled format.

    Aside from the fact that there are really no VBA modules in the document (only form pick-lists), how can I do this via code? What FileFormat should be used? (Why is this so nebulous!?)
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts
    You need to enable the new features first:


    In the SaveAs line, specify wdFormatXMLDocument or if that doesn't work, wdFormatXMLDocumentMacroEnabled as FileFormat. In the latter case, you should use extension .docm instead of .docx.

Posting Permissions

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