M
MrBill
I need a macro to close as many documents as might be open in Word
2007, saving none of the changes, then closing Word. The following
(borrowed from Excel 2003 and modified) works with 1 document but not
when I have 2 or more. Can anyone help?
Thanks, Bill
====================
Sub CloseAll_Quit()
'
' CloseAll_Quit Macro
' Written by Bill Mullin
'
On Error GoTo errorHandler
ActiveDocument.Close _
SaveChanges:=wdDoNotSaveChanges, _
OriginalFormat:=wdWordDocument
errorHandler:
If Err = 4198 Then MsgBox "Document was not closed"
Application.Quit
End Sub
====================
2007, saving none of the changes, then closing Word. The following
(borrowed from Excel 2003 and modified) works with 1 document but not
when I have 2 or more. Can anyone help?
Thanks, Bill
====================
Sub CloseAll_Quit()
'
' CloseAll_Quit Macro
' Written by Bill Mullin
'
On Error GoTo errorHandler
ActiveDocument.Close _
SaveChanges:=wdDoNotSaveChanges, _
OriginalFormat:=wdWordDocument
errorHandler:
If Err = 4198 Then MsgBox "Document was not closed"
Application.Quit
End Sub
====================