• Attached Template changes if created from .doc (2002/XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Attached Template changes if created from .doc (2002/XP)

    Author
    Topic
    #429870

    I’ve built a system of templates with one ‘master’ template (let’s call it joel.dot) and about 200 ‘content’ templates (i.e. cover page.doc, study report.doc) which are all attached to the Master.
    The .doc files are in the local or workgroup template folder so that they’re available from File > New > General Templates (called Templates on My Computer in 2003).

    When the new doc is created, it’s nicely a “Document3” unnamed doc, and attached to joel.dot.
    Under 2002 SP3 (but not 2003), when the document is saved and reopened, the attached template is listed as “cover page.doc”.
    I’ve tried at the “Immediate” box to explicitly set the Activedocument.attachedtemplate to “joel.dot” prior to saving, and it didn’ t seem to make a difference.
    Once opened, if the attached template is changed, it doesn’t revert again. It’s just the first save that seems to be wrong.

    Has anyone seen this? Might there be a way around it? I haven’t tried hooking the SaveFile command.

    Viewing 1 reply thread
    Author
    Replies
    • #1002256

      Hi Joel:
      >>I’ve built a system of templates with one ‘master’ template (let’s call it joel.dot) and about 200 ‘content’ templates (i.e. cover page.doc, study report.doc) which are all attached to the Master.<>The .doc files are in the local or workgroup template folder so that they’re available from File > New > General Templates (called Templates on My Computer in 2003).<>When the new doc is created, it’s nicely a “Document3” unnamed doc, and attached to joel.dot.<>Under 2002 SP3 (but not 2003), when the document is saved and reopened, the attached template is listed as “cover page.doc”.<<

      While I don't have Word 2002, I don't know why the attached template should change, unless you are specifically doing something to make it change.

      I'm not quite sure what you're trying to accomplish by having .doc files as templates. You could create documents based on Joel.dot, modify them by copying styles & boiler plate from cover page.doc etc. & save them as templates. If you have macros or autotext in joel.dot that you need for these different types of documents, you could either put them in these new templates themselves or put joel.dot in the Word startup folder, so they would be available globally.

      Hope this helps,

      • #1002271

        > I’m not positive what you’ve done, but “cover page.doc” is 1) either a template renamed from a .dot extension to a .doc extension, or 2) it’s a document.
        It’s a document.

        > If it’s a document, then the attached template will be the one that the “cover page.doc” document is attached to (i.e. joel.dot).
        That’s what it’s supposed to do… and doesn’t after the first save (but if reset later it does stick)

        >I don’t know why the attached template should change, unless you are specifically doing something to make it change.
        Nope, no hooks on FileSave or anything like that.

        > I’m not quite sure what you’re trying to accomplish by having .doc files as templates.
        Several things
        1) Macros are maintained in only one place, rather than the 200 ‘content’ templates
        2) Macros are only available for documents based on the template (rather than being a global template)
        3) .doc files, when placed in Documentum as their (cough) templates, make more .doc files. .dot files placed in the Templates cabinet of Documentum, make more .dot files (ick)

        Actually, after posting here, I found someone else who had the same problem.
        A certain security hotfix for Office 2002 (and possibly 2003) causes this problem, which is fixable with an AutoNew macro

        Sub AutoNew()
        dim s as string
        s = ActiveDocument.AttachedTemplate.FullName
        ActiveDocument.AttachedTemplate.FullName = NormalTemplate.FullName
        ActiveDocument.AttachedTemplate.FullName = s
        end sub

        • #1002285

          Hi Joel:
          I’m glad you posted the follow-up. I can see your reason for using docs in the template folder to keep macros in one template & only available to certain documents. You could load Joel.dot as an add-in for only those documents, but it gets a little tricky (at least for me grin). I experimented one time with using an AutoOpen macro to load the add-in & an AutoClose macro to unload it. Trouble was if you had two such documents open & you close one, the template is unloaded.

          I’m curious as to where you found the solution (if you have a link).

          When you said
          >>3) .doc files, when placed in Documentum as their (cough) templates, make more .doc files. .dot files placed in the Templates cabinet of Documentum, make more .dot files (ick)<<

          I'm not sure what you mean. When you either double click or use File/New on a template, you get a document. You shouldn't get another template unless you're opening the template.
          Cheers,

        • #1002289

          Hi Joel,

          We had similar problems when we first implemented Documentum. This is the solution that works for us:
          1. ALL code is placed in a code-only template (your joel.dot?) in Word’s startup folder
          2. regular templates are placed in the Workgroup templates folder and they contain a CustomDocumentProperty (CDP) “Documentum” with value “YES” if the template is to be used with Documentum
          3. regular templates contain NO code at all, they’re just ‘boilerplate’ templates with FormFields and AutoText entries
          4. ‘virgin’ docs are created from these templates, meaning that no code is run when created (hold Shift key pressed when creating)
          5. those ‘virgin’ docs are imported in the Templates cabinet of Documentum
          6. when users do a ‘create doc’ or ‘open doc’ from within Documentum, the doc is put in the ‘checkout’ folder and then Word opens it and finds the attached template in the Workgroup templates folder
          7. in the code-template we use applications events wdApp_NewDocument and wdApp_DocumentOpen which test for CDP “Documentum” to ‘know’ if it should run the Documentum-relevant code

    • #1002325

      (Edited by HansV to make URL clickable – see Help 19)

      The full characterization and cure for this problem was found here

      It’s an undocumented side effect of a Microsoft Office hotfix (sic), which is why we’ve only seen it on a few people’s machines, it’s only those folks who’ve bothered to get fully patched that have the problem.

      Joel

    Viewing 1 reply thread
    Reply To: Attached Template changes if created from .doc (2002/XP)

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

    Your information: