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

Can You Close The Word Default "Save Changes" Dialogue Box on Close?

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
Good afternoon. We have a Word document form where we have created a Dialog Box to ask the user if they want to save the changes to the form if they just "X" the window down (Ctrl/Alt + F4). What we'd like to be able to do is disable/close the standard "Do you want to save the changes" dialog box. Setting display alerts to false doesn't seem to do it, unfortunately. We can't seem to find what it's called either! I haven't found the solution "out there".

Many thanks,
D€$
 
ActiveDocument.Saved = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV. Apologies for not being more specific; we don't want it saved as it's a dotx template we're using.
What we want to be able to do is just to close the form down if they've decided not to carry on but not get prompted by Word. We have our own dialog box that prompts them to save or not but can't appear to be able to put code behind that to just close the template due to the standard dialog box being open.

Many thanks,
D€$
 
I didn't suggest to save the doc wut lie to word ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I didn't suggest to save the doc but lie to word ...
 
Oh, I see; we tell word that the template has already been saved - presumably prior to launching our own "Do you want to save the changes" dialog box? But how would we be able to anticipate where/when the user was about to bomb-out of the process? If we put that line of code in (say) at the start of the code, would our dialogue box still get triggered? I guess we'll have to try and find out!

Many thanks,
D€$
 
>If we put that line of code in (say) at the start of the code,

The problem with that is that any edit of the document subsequent to the line being run will cause it to be reset to False, so you can only use it with confidence when you know that there will be no further changes to the document. Which is generally at the point of exit ...

>But how would we be able to anticipate where/when the user was about to bomb-out of the process?

Er ... the document's Document_Close event would seem ideal, or the Application's DocumentBeforeClose event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top