Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    San Francisco, California, USA
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Distributing macros with documents (2003)

    Everyone helped me so much with my to-do list macro problem that I now have a whole set of procedures. My problem now is, how do I get all the procedures to run when I distribute the document to other people? Right now, I've got a template (TODO.DOT). That template contains some text in the form of an empty table that's formatted with the columns I want, a title, etc. It also contains a module with about 7 procedures, which relate to the macros I'm using to do various things in the table, so to-do list entries can be added, deleted, and marked "done." If I create a document based on that template and distribute that doc to others, none of the macros runs. This seems to be because the macros are stored in TODO.DOT, the template, which they don't have. So I tried to solve the problem by copying all the code into a module that's attached directly to the doc that was created from the template. Still no go, evidently because the document contains a reference to TODO.DOT, which of course the other users still don't have.

    My workaround has been to create a document based on normal.dot, copy a blank table with the correct format into that new doc, and then copy all the procedures I need into a module attached to this new document. Now, the macros **seem** to run OK (I'm still waiting for some folks to do testing), evidently because the doc itself has all the correct procedures attached, and because the only reference is to normal.dot, which everyone has.

    That can't possibly be the right way to do this. It's soooo kludgy.

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Distributing macros with documents (2003)

    The normal process is for the users to use the DOT file as a template, so that you would either put it on your network in the location where all your users have configured Word to look for Workgroup Templates (Tools > Options > File Locations). OR you can send them the template with instructions to copy it to the user templates folder.

    StuartR

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Distributing macros with documents (2003)

    You can provide the template TODO.DOT to others. They can create new documents from it that will automatically refer back to their copy of TODO.DOT, so the macros will be available to the document.

    Or, if all potential users are on a common network, make the TODO.DOT template available in a shared network folder. Again, users can create new documents from it.

  4. #4
    2 Star Lounger
    Join Date
    Dec 2002
    Location
    San Francisco, California, USA
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distributing macros with documents (2003)

    Thanks, but that's really not an option. The users aren't all on the same network, and every one of them would require instructions for installing the template (which they wouldn't want to follow). I need a solution that consistes fo something self-contained in the actual document we share.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Distributing macros with documents (2003)

    If you need it to be kludgy, so be it.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Distributing macros with documents (2003)

    Although a user would need to save TODO.DOT in the "correct" place for it to appear in the File>New dialog, they can use it anywhere they save it if they double-click it in Windows Explorer. If you think they might open it directly from Word's File>Open, you can create some AutoOpen or Document_Open code to prevent editing of the original template, forcing the creation of a new document. I'm attaching an example I posted back in 2002 (faster to find on my computer than here in the Lounge). What do you think?

Posting Permissions

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