Consulting

Results 1 to 5 of 5

Thread: Attach template refused with error 5947 Could not change document template

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Attach template refused with error 5947 Could not change document template

    If I try to attach an already attached template to a document, this is granted.
    If I try to attach another template to a document is ends in error 5947 and no change is made.

    Why would I try to sweep a carpet under a document?
    Originally the document is made based on a template X.dotm. So this X gets known as being attached (ActiveDocument.AttachedTemplate).
    If this document is handed to someone on a different pc who also has those templates but likely in a different (trusted) location (say, D:\templates\X.dotm), there is a need to reattach to that template so all functionality and QAT buttons remain valid.
    This can be done manually, but I prefer to do it from an AutoOpen routine that checks if the current attached template exists and if not, reconnects to the proper one. (This introduced an additional task to remove the non existent template from the Tools>References list as MISSING which caused the VB compiler to suddenly bark at innocent statements).

    I don't seem to be able to use Activedocument.AttachedTemplate = newtemplate without running into this 5947 problem.
    Which is odd, because an initial effort as "proof of concept" with an almost empty file based on one of two almost identical almost empty templates X1 and X2 did allow me to swap between the two. Which made me think that swapping would be a no-brainer.
    But it now is not. Why?
    Last edited by deklerkt; 05-03-2018 at 03:58 AM. Reason: additional clarification

Tags for this Thread

Posting Permissions

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