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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing Word Doc

Status
Not open for further replies.

keenanbr

Programmer
Oct 3, 2001
469
IE
When closing a word document is there a way I can stop the 'Do you want to save' message popping up.

Regards,

 
FROM

Word uses a slightly different version of the same property. Instead
of accepting a Boolean value, Word uses three Long constants: wdAlertsNone,
wdAlertsAll and wdAlertsMessageBox. The first two settings are
fairly self-explanatory. The last setting tells Word to display
only standard message box alerts.

Under normal conditions, the code statement:

ActiveDocument.Close

would generate a message box asking if you wanted to save the document
in question. Using the DisplayAlerts property, the following code

Application.DisplayAlerts = wdAlertsNone
ActiveDocument.Close
Application.DisplayAlerts = wdAlertsAll

would immediately open the SaveAs dialog box without the initial
prompt.




swtrader
-- If you don't know where you're going, you'll always know when you're not there.
 
I never want the user to save the document. The user just fills in fields and prints. I have a template attached to the doc and in the Close_Document i put

ActiveDocument.save = True

This accomplishes the task as required.
 
ActiveDocument.Save[!]d[/!] = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top