Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word Add-in - Don't ask to Save on Close (XP)

    I have a word .dot file that I'm using as an add-in. Sometimes the user uses a menu that needs to be updated on the add-in. When the user goes to close word, it asks if the user wants to save the changes to the add-in. How do I prevent word from asking the user to save?

    I've tried to use this, but no success:


    Public WithEvents appWord As Word.Application

    Private Sub appWord_DocumentBeforeClose _
    (ByVal Doc As Document, _
    Cancel As Boolean)
    ActiveDocument.Saved = True

    End Sub

    Thanks,
    Vetter

  2. #2
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Add-in - Don't ask to Save on Close (XP)

    I will assume that this is a globally attached template. This usually happens when the template is attached and someone makes a change to say, for instance, a custom toolbar which you created (they may have just moved it to another location). Try inserting another line specifically for the template:

    ActiveDocument.Saved = True
    ActiveDocument.AttachedTemplate.Saved = True

    Hope this helps! trish

  3. #3
    New Lounger
    Join Date
    Jul 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Add-in - Don't ask to Save on Close (XP)

    Thanks for the suggestion but no luck! Any other thoughts?

  4. #4
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Add-in - Don't ask to Save on Close (XP)

    Another thought... Found this on Google... if in fact you are using customized menus and it is a global template, you will need to find the code which is modifying the toolbar and use the ThisDocument.Saved = True in each set of code which makes a modification (i.e., ButtonUp)... here is the link: http://groups.google.com/groups?hl=en&lr=&...6.248.16&rnum=2

  5. #5
    New Lounger
    Join Date
    Jul 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Add-in - Don't ask to Save on Close (XP)

    Exactly What I needed!! Thanks!!

Posting Permissions

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