How to you remove the reference to a template

Discussion in 'Word Programming' started by poranui, May 8, 2009.

  1. poranui

    poranui Guest

    I created a document using word 2007, it was based on a template which
    already had the styles in that I wanted. However the template also has
    loads of macros in it which for this document I do not need. It also
    has a custom ribbon which is not needed either.
    As the macros and ribbon are stored in the template, I cannot remove
    them without editing the template itself which I do not want to do.
    So how can I remove the reference to the template so that the ribbon
    is not visible when the document is opened.

    Also as an aside, it means that although it is a .docx file it is
    still macro enabled because the template it was based on is maacro
    enabled which seems a bit of a potential security threat.
    poranui, May 8, 2009
    1. Advertisements

  2. poranui

    poranui Guest

    Apologies, ignore the question I found the solution just after I
    posted the question
    temporarily rename the template, open the doc, then it will prompt you
    to delete the reference, the next time you open the document the
    reference is gone.
    poranui, May 8, 2009
    1. Advertisements

  3. poranui

    Jay Freedman Guest

    Go to the Developer tab and click the Document Template button. In the dialog,
    click the Attach button in the upper right and choose the Normal.dotm template
    to replace the document's base template.

    The macros and custom ribbon will be gone. Also, the document will _not_ be
    macro-enabled -- a .docx file cannot be macro-enabled by definition -- and there
    is no security threat.
    Jay Freedman, May 8, 2009
  4. poranui

    poranui Guest

    Thanks, that is an easier way

    Although it is a docx the macros in the template that it was based on
    are still enabled and do still work as long as the user has access to
    the template.
    I agree you can't save macros inside the docx file itself, but it can
    still run macros from the template.
    poranui, May 8, 2009
  5. poranui

    Jay Freedman Guest

    That's correct. It's a different interpretation of the term "macro-enabled".

    In Microsoft lingo, a "macro-enabled" document is one that's saved as a .docm
    file, with the macros in the document itself rather than in the template. If you
    have a .docm file with macros and you use Save As to save it as a .docx file,
    Word will warn you that it will remove the macros.

    Having macros in an attached template, when that template is stored in a trusted
    location (usually the Templates folder), is not a security threat -- especially
    if the macro project is digitally signed.
    Jay Freedman, May 8, 2009
  6. poranui

    poranui Guest

    Probably not a threat in our case as we control the templates quite
    strictly, though most staff tend just to enable macros regardless of
    where the document is from. It probably would only be an issue if
    there was a disgruntled employee who put a malicious template in a
    pulic shared network drive. slightly going off topic but would it be
    possible for the reference to be to a template on a web server?

    I have to say I was surprised that .docx were not what I thought they
    were, I had previously thought that they would not run macros at all.
    poranui, May 8, 2009
  7. poranui

    Jay Freedman Guest

    Yes, although it would be a file server rather than (or in addition to) a
    web server. Just use the Browse button in the Templates and Add-Ins dialog
    to locate the proper template. Of course, that means everyone who opens the
    document must have the rights to access the server, the share, the folder,
    and the file.
    With respect to macros, a .docx is exactly like a .doc file except that it
    can't _contain_ the macros but must access them from an attached template.
    Only a .docm file can also contain the macros.

    Jay Freedman
    Microsoft Word MVP
    Email cannot be acknowledged; please post all follow-ups to the newsgroup so
    all may benefit.
    Jay Freedman, May 8, 2009
  8. poranui

    poranui Guest

    but would it be
    I sucessfully managed to add a reference to a share point server
    template. I can run the macros in the template, though my collegue
    only gets a warning about them, but cannot see them in the template,
    however she still gets the custom toolbar.
    poranui, May 10, 2009
  9. poranui


    Many Thanks Jay...... your answer solved my problem... cheers.... :)
    , Oct 15, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.