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

Saving all and closing a file

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I am trying to write a macro that does the equivalent of clicking File...Save All and then File...Close. So far I have:

Sub SaveAll()
'
' SaveAll Macro
' Macro recorded 20/02/2007 by Authorised User
'
Documents.Save
ActiveDocument.Close
End Sub

However the problem I've got is that if you make any changes to the document then run the macro it will ask you if you twice if you want to save the document. All I want it to do is to save the open document and also save the normal.dot then close.

Where am I going wrong?

Thanks very much

Ed
 
You may try this:
Documents.Save True
ActiveDocument.Close wdSaveChanges

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top