Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Always getting prompt to save an Addin (Word 2000)

    I have this Word addin, a dot file, that is loaded and only contains a module with VBA code that accesses a COM addin. For some reason when I close a Word document, even if no changes have been made to it I get a dialog asking me if I wish to save te addin template (name.dot). I tried using Templates("name.dot").Saved= true but I get an error message that the template is not in the collection. I can see that the Addin is in the addins collection but how do I tell Word that the addin is not dirty?

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Always getting prompt to save an Addin (Word 2000)

    I get the same result as you, but this seems to work...
    <font face="Georgia">
    Dim tmplTemplate As Template
    For Each tmplTemplate In Application.Templates
    If tmplTemplate.Name = "Name.dot" Then
    tmplTemplate.Saved = True
    End If
    Next tmplTemplate
    </font face=georgia>
    StuartR

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Always getting prompt to save an Addin (Word 2000)

    If the Templates collection is like the Documents collection, the non-numeric index might be the full path rather than just the file name. Does that work?

    (P.S. A change is being made to the template, apparently unintentionally, or you wouldn't get the prompt.)

  4. #4
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Always getting prompt to save an Addin (Word 2000)

    Thanks StuartR your code segment below fixed it.

    Dim tmplTemplate As Template
    For Each tmplTemplate In Application.Templates
    If tmplTemplate.Name = "Name.dot" Then
    tmplTemplate.Saved = True
    End If
    Next tmplTemplate

Posting Permissions

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