Changed document, want to close without prompt to save

S

Stan Brown

This is *not* a case of getting "Do you want to save changes?" when I
didn't actually make any. Rather, I open a document used by my whole
workgroup, make a few changes, print it, and close it.

I want to *not* be prompted to save when I close this one particular
changed document -- is there any setting I can make?

Word 2003, Win XP Pro
 
S

Stefan Blom

A macro such as the following, attached to a toolbar button, would do
what you want:

Sub DoNotSaveChanges()
ActiveDocument.Close savechanges:=False
End Sub

If you need assistance, see http://gmayor.com/installing_macro.htm.

Of course, if it is run on the wrong document, the macro will cause a
loss of data, so use it with care!

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
S

Stan Brown

Tue, 20 Jun 2006 15:14:52 +0200 from Stefan Blom
in message
A macro such as the following, attached to a toolbar button, would do
what you want:

Sub DoNotSaveChanges()
ActiveDocument.Close savechanges:=False
End Sub

If you need assistance, see http://gmayor.com/installing_macro.htm.

Of course, if it is run on the wrong document, the macro will cause a
loss of data, so use it with care!

Thanks, Stefan. I'm a little reluctant to create such a toolbar
button, because of just the risk you cite. Is there nothing in the
GUI to accomplish this same result? I couldn't find anything, but I'm
hoping against hope that it's there and I just missed it.
 
G

Graham Mayor

A minor addition to Stefan's macro will limit the macro to the one document.

Sub DoNotSaveChanges()
Dim strName As String
strName = ActiveDocument.Name
If strName = "Document name.doc" Then
ActiveDocument.Close savechanges:=False
End If
End Sub

Where Document name.doc is the name of the document in question. For all
other docs the macro does nothing.
Any global changes would have the same problems as the original macro.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top