• Template from template loses code (Word 2000 SR1)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Template from template loses code (Word 2000 SR1)

    Author
    Topic
    #362311

    I created a template containing a macro, which is run from an embedded {MACROBUTTON} field in the first paragraph. The macro deletes the first paragraph, which only contains instructions on how to use the template.

    This works great with the template, and any document created from the template.

    But I also want to be able to create new templates from this one, because it contains a specific Outline Numbering scheme.

    So when I create a new document from this template, Tools> Templates and Add-ins indicates the current Document Template.

    But as soon as I save the new document as a template, “Document Template” is blank and disabled (makes sense, it is now it’s own template), but the code does not work anymore, because it’s gone.

    How can I retain my code in this second-generation template?

    Thanks – Klaus

    Viewing 0 reply threads
    Author
    Replies
    • #549874

      Hi Klaus,

      Open the original template and do a Save As from there, not from a document based on the template.

      HTH,

      Chris

      • #549909

        Fair enough, that’ll work. It’s just that this template will be shared with corporate users, that may have been (finally) trained to right-click and select “New”, or are selecting the template via Word’s File> New dialog, which includes the Workgroup Templates, where I store the template in question.

        Thanks for your reply.

        Klaus

        • #549938

          Klaus,

          Just to clarify further, when the users select “New” or use File > New, they are creating a new document, based on that template. Any macros that are in the template stay in the template; the new document will not contain any of the macros.
          If you then save this (macro-less) document as a template, the new template will be similarly macro-less.
          You could then use the Organizer if necessary, to copy macros from the original template, into the new template.

          But given that you want to reproduce the outline numbering scheme that’s in the original template, why is it necessary to give users access to creating their own new templates? – isn’t letting them create new documents, based on your original template, good enough?

          Gary

        • #549967

          Try this:

          Sub NewTemp()
          Documents.Add Template:=ActiveDocument.AttachedTemplate.FullName, NewTemplate:=True
          End Sub

    Viewing 0 reply threads
    Reply To: Template from template loses code (Word 2000 SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: