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 / August 2006

Tip: Looking for answers? Try searching our database.

Closing Word without the prompt to save changes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mleviton@juno.com - 03 Aug 2006 20:41 GMT
I am using an Access db to populate  a word document, print it, and
close it.  When it runs, the user should not be promted to save changes
when the document closes.  The code includes
objWord.Documents("timesheet.doc").Close SaveChanges = False and
works on the win2000 server but the win2003 server prompts the user to
save changes.  The following line works on our 2000 server (Office 10),
works on XP pro (Office 11) but not on 2003 server (Office 11).

           objWord.Documents("timesheet.doc").Close SaveChanges =
False

We have also tried the following on our 2003 server without any luck:

Application.Quit(Word.WdSaveOptions.wdDoNotSaveChanges)

Private Sub Document_Close()
Me.Saved = True
End Sub

Application.DisplayAlerts = wdAlertsNone

objWord.Documents.Active.Close wdDoNotSaveChanges

All of these still prompt to save changes.
Thanks in advance for the help - PPT
Dave Lett - 03 Aug 2006 21:02 GMT
You can try

Application.DisplayAlerts = wdAlertsNone

before the close event.
After the close event, you can reset the .DisplayAlerts property again.

HTH,
Dave

>I am using an Access db to populate  a word document, print it, and
> close it.  When it runs, the user should not be promted to save changes
[quoted text clipped - 21 lines]
> All of these still prompt to save changes.
> Thanks in advance for the help - PPT
mleviton@juno.com - 08 Aug 2006 14:40 GMT
Thanks Dave, but I still get prompted to save changes when I use
Application.DisplayAlerts = wdAlertsNone
Could there be something else overriding this code?

-PaPaTwin

> You can try
>
[quoted text clipped - 5 lines]
> HTH,
> Dave
Dave Lett - 08 Aug 2006 19:45 GMT
Hi,
You can also try using

ActiveDocument.Saved = True

HTH,
Dave

> Thanks Dave, but I still get prompted to save changes when I use
> Application.DisplayAlerts = wdAlertsNone
[quoted text clipped - 11 lines]
>> HTH,
>> Dave
mleviton@juno.com - 09 Aug 2006 17:23 GMT
Awesome!  That line worked.  Thanks Dave.

> Hi,
> You can also try using
[quoted text clipped - 3 lines]
> HTH,
> Dave
 
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.