Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

Disable Save prompt on Close

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JHARRIS133 - 01 Jun 2005 00:11 GMT
I am trying to disable to Save prompt that appears when a document is closed
in Word 2003.  I have found several code samples on the MSDN website, none of
which seem to work.  I am writing this code in the Document_Close event.  It
could be that the code is correct, but it should be placed somewhere else.  
Below are the three variations I have tried to no avail, any assistance would
be greatly appreciated.

ThisDocument.Close SaveChanges :=wdDoNotSaveChanges
Documents(ThisDocument).Close SaveChanges:=wdDoNoSaveChanges
ThisDocument.Close (Word.wdSaveOptions.wdDoNotSaveChanges)

Again, this is to disable the Save prompt when closing the document.
MWK - 01 Jun 2005 03:14 GMT
Just try Thisdocument.Close SaveChanges:=False

>I am trying to disable to Save prompt that appears when a document is
>closed
[quoted text clipped - 12 lines]
>
> Again, this is to disable the Save prompt when closing the document.
JHARRIS133 - 01 Jun 2005 21:27 GMT
Thanks, that version works...but only when I am debugging and stepping
through the Document_Close() event line by line.  I have even put a msgbox
right before the Close event is called to verify that I am there.  When I
debug, the message displays, then the document closes.  When I run a Close
command from within Word, I still receive the prompt to save.  

Do you know what other event could be interfereing here?

> Just try Thisdocument.Close SaveChanges:=False
>
[quoted text clipped - 14 lines]
> >
> > Again, this is to disable the Save prompt when closing the document.
MWK - 04 Jun 2005 14:08 GMT
Try this Thisdocument.Saved=True

This should trick Word into thinking the document has been saved and should
not prompt you to save.

> Thanks, that version works...but only when I am debugging and stepping
> through the Document_Close() event line by line.  I have even put a msgbox
[quoted text clipped - 25 lines]
>> >
>> > Again, this is to disable the Save prompt when closing the document.
MWK - 04 Jun 2005 14:18 GMT
I played with this and it will work on existing documents.  It doesn't work
if the document has never been saved before.

> Thanks, that version works...but only when I am debugging and stepping
> through the Document_Close() event line by line.  I have even put a msgbox
[quoted text clipped - 25 lines]
>> >
>> > Again, this is to disable the Save prompt when closing the document.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.