thandel
asked on
Run macro before closing to prevent prompt to save document
I would like to run a macro before a document is closed.... specifically I don't want Word to ask if they would like to save the document even if they made changes. I tried
Sub Document_Closed ()
ThisDocument.Saved = True
but I still get prompted to save the document.
What did I do wrong?
Sub Document_Closed ()
ThisDocument.Saved = True
but I still get prompted to save the document.
What did I do wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I updated your code to this so it simply closes... where it needs to be saved or not.
Sub AutoClose()
ActiveDocument.Saved = True
End Sub