Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Template Question (Word XP)

    I have a template saved in the template directory, under a subfolder. When I use the template to create a document, save and close WORD, I am asked if I want to "save changes to template 'xyz'?

    How can I prevent this question from being popping up? ( I have the files saved as 'read only')

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Template Question (Word XP)

    1. Remove the code that makes a change to the template (good luck).
    2. Add a line of code that tells Word that the template is not "dirty"; therefore,
    the prompt is avoided.

    Since you have a VBA6 host you can put the code in one of the app events like
    DocumentBeforeClose

    The line of code:

    activedocument.attachedtemplate.saved = true

    or the slightly more elegant:

    thisdocument.saved = true
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    215
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Template Question (Word XP)

    So ,

    Private Sub Document_Close()
    ThisDocument.Saved = True

    End Sub


    would close the document and bypass this questioning?

    As far as "removing the code that changed it".... I don't even know what it's considering a change. I can create a document, based on the template, type NOTHiNG, do NOTHING... close the document and I'll be asked to save changes to the template.

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Template Question (Word XP)

    I shouldn't have tried this from memory. Sorry.

    Here's a post that should help: <post#=116985>post 116985</post#>

    If you need more info, do a search on

    thisdocument.attachedtemplate.saved = true
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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