Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close Word WithOut Prompt

Status
Not open for further replies.

Jhtexas

Technical User
Jan 4, 2005
59
US
I want to be able to remove the “Save Prompt” for certain users when closing there documents because the changes should not be saved. I tried the simple macro below with no luck. Any ideas?

Sub AutoClose()
ActiveDocument.Close wdDoNotSaveChanges
End Sub
 
Setting ActiveDocument.saved to false should keep it from asking them if they want to save
 
Guys,
I've tried both suggestions without success.

Sub AutoClose()
ActiveDocument.Saved = False
End Sub

&

Sub Sub Document_Close()
ActiveDocument.Saved = False
End Sub

Any ideas?

Thanks for your help,
Jim
 
I worked with this for awhile and the got the following code to work with the AutoClose but not the Document_Close.
Does it make sense that the true value is correct?

Sub AutoClose()
ActiveDocument.Saved = True
End Sub

Thanks,
Jim
 
It looks like "True" is used to not save the cahnges with the saved property.

Example
This example saves the active document if it contains previously unsaved changes.

If ActiveDocument.Saved = False Then ActiveDocument.Save

This example changes the status of the Normal template to unchanged. If changes were made to the Normal template, the changes aren't saved when you quit Word.

NormalTemplate.Saved = True
Application.Quit

 
Oh yeah, Sorry that was a typo and I hadn't had a chance to get back on. True is what it is supposed to be
 
No problem, thanks for getting me on the right track.

Take care,
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top