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

How i can close a word doc without appear the confirm box?

Status
Not open for further replies.

diembi

Programmer
Sep 22, 2001
238
ES
Hello!!
How I can to close a word doc without appear the <b>Confirm to save de doc</b>??? I have tried to do this using the next code: <font color=&quot;red&quot;>oWord = DisplayAlerts=wdAlertsNone </font>, but the confirm dialog box continue appearing.

Thanks people!!!
 
Hello, danielmontejo.

<friendly advice>
First stick to one single thread as long as the subject matter dictate and time lapse not too far apart, and that readers can follow the progress of an issue, and that the original helper(s) has a chance to make good a piece of advice which turns out not working within the same thread, and that netiquette dictate.
</friendly advice>

I think what DaveWoodall suggest in the original thread329-139740 in this context is:

oWord.DisplayAlerts = 0 'wdAlertsNone = 0

So, what you put in the script is not what DaveWoodall proposes.

Unfortunately, the advice may be a good one but _not_ in this context. DisplayAlerts setting has no control on this.

Word would behave as what you describe under the condition that you've not saved the document in the first place. But, you might not want actually not to save the document, fair enough.

In any case, two possible ways to quit the Word with some document hanging there.

[1] Close the documents first

oWord.Documents.Close
oWord.Quit

or
[2] Directly Quit Word without saving changes

oWord.Quit(0) 'wdDoNotSaveChanges = 0

regards - tsuji
 
Hi tsuji,

Thanks for your help.
Your help has been very usefull!!!

Bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top