Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Apr 2001
    Washington, Washington, USA
    Thanked 0 Times in 0 Posts

    FileSave Macros (Word 2000)

    I have a number of templates created for a client. A couple of them have FileSave and FileSaveAs procedures to allow the insertion of some document-checking code. That works fine.

    Now I need to add FileSave and FileSaveAs code to all the templates (well, those that start with a certain prefix). What is the priority order of macros with the same name? I'm assuming that the attached document template gets priority over a template in the Startup folder (which is where I want to put the code that runs on all the templates). Is that right?

    And, is there a way to jump from the FileSave macro attached to the document to then run the OTHER FileSave macro in the global template? I don't want to have to maintain this new code in several templates, but I don't want to move the existing macros to the global template, either. I tried adding this code to the end of the first FileSave module:

    Application.Run "''.MyModule.FileSave"

    but I get an error:

    Run-time error '-2147352573 (80020003)': This command is not available.

    Any suggestions on how to make this work? Or ideas for another approach? Basically, I need to run the existing FileSave macros if they exist and ALSO run the new FileSave routine housed in a different location (and which will work with all templates, including those without an existing FileSave macro).

    As always, many thanks!


  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: FileSave Macros (Word 2000)

    Microsoft has a KB article on the order that Auto macros execute, and I suspect that the command override macros are similar: if I remember correctly, it is document, attached template,, global templates and add-ins in alpha order.

    The Application.Run syntax is tricky. You're probably best off starting from the Module.Procedure and then if that doesn't work, experiment with ! notation rather than . notation to separate the template file name from the module name.

    In your global template, it might help if you put the code in a different procedure, such as:

    Public globalFileSave()

    and call that from all of your FileSave procedures.

Posting Permissions

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