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

Disable Save Prompt 2

Status
Not open for further replies.

medieval

Technical User
Joined
Jun 18, 2003
Messages
31
Location
GB
I have used the command ActiveDocument.Close but
how do you disable the Window Prompt which asks you if
you wish to save the document prior to closing it.

thanks for reading this.

sig
Medieval.

 
Hiya,

try using [tt]application.DisplayAlerts = wdAlertsNone[/tt]

HTH

Cheers
Nikki
[bat] Look, mommy, I'm flying!
 
PS you'll need to switch DisplayAlerts back on once your code has finished: use [tt]Applciation.DisplayAlerts = wdAlertsAll[/tt]
If you don't, Word will not show any propts until you close & reopen the app



Cheers
Nikki
[bat] Look, mommy, I'm flying!
 
Hi Nikki,

That was a really quick reply. Thank you.
However this did not work. :-(
I am using MS Word, does this make a difference ?
 
Hiya

Question: d'you want the document saved or do you just want to close the document without saving any changes?



Cheers
Nikki
[bat] Look, mommy, I'm flying!
 
Try this just before the close:
ActiveDocument.Saved = True

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Well, just to close it without having it saved.
 
[tt]ActiveDocument.Close False[/tt] will close the doc without saving
Alternatively, add PHV's line to your code just before the [tt]ActiveDocument.Save[/tt] bit

HTH

Cheers
Nikki
[bat] Look, mommy, I'm flying!
 
Thank you Gentlemen.
This worked....

ActiveDocument.PrintOut
ActiveDocument.Saved = True
ActiveDocument.Close

thanks once again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top