Share via

Error message when re-attaching document to master/global template

Anonymous
2012-10-23T23:40:52+00:00

While trying to re-establish (re-attach) connection from a document to the global template it was created from I got an error that said "Word cannot attach a document to a protected template".  Neither the document nor the template are protected, though, they were until I unlocked them for this test.  I removed an auto-open macro from both the document and template so everytime it is opened, it is in an unprotected state.  What might I be looking for to resolve this problem???  Help is greatly appreciated.

Lenny33

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2012-10-25T02:57:59+00:00

    How are you "re-attaching the template to the document"

    Via the Developer Tab>Document Template>Attach... facility, I am able to attach a template that contains reams of code and a number of user forms and ribbon customizations to a document without any issues, even after opening that template and protecting it with a password.  The ribbon customizations from the template then do appear on the ribbon.  (I will admit that they do not work correctly in this case because the code is designed to access values from variables in the document that do not exist.  It does work however up to that point.

    The text of the error message that you are quoting seems a bit strange, because templates are attached to documents, rather than the other way around.

    If you want to send your template to me, I will see if I can attach it to a document.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-10-24T20:39:14+00:00

    Based on your information above, I have three files.  The original target template .dotm (with macros/code but not actively locked.  When tested thru opening, closing and reopening. File responds in unprotected state with all tabs being accessible.  When re-attaching this document, error message "Word cannot attach a doucment to a protected template".

    I then saved this file as a .dotm, only this time, stripping out all the code and saving.  I was able to attach this file to my document.

    I again saved the original target template as a .dotx and stripped out the code and was again, able to attach the document.

    This is a definite problem, as the intent is to re-attach a document to a template that has vb customizations exhibited on a tab and the employee needs to be able to re-establish this connection.

    Is this by intent or a surprise to you?  Lenny33

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-10-24T16:04:29+00:00

    Hi Lenny33,

    Thanks for asking! Let me try to help you out in attaching the Word document to the global template, but I’m going to need a few more details first.

    1.       Is this an issue while attaching one particular document?

    2.       How exactly are you trying to attach the document to the global template?

    3.       Are you using the ‘Attach’ option in File > Options > Add-ins > Manage Templates > Templates tab?

    Are both the document and the template present on the local computer, or are they on a network or a server?

    If it’s on a network/server, try to attach the document to the template using local copies and see if that works fine.

    Another reason this might happen is if the template is still in a protected state even though you have removed the concerned macro. To confirm this, you may check if you’re able to attach some other basic document which does not contain any macros, and check if that works fine.

    Let us know the status and please ask if you need anything else. We’ll be glad to help.

    Was this answer helpful?

    0 comments No comments