Hi,
Try this (on one line)
Documents.Close
saveChanges:=wdDoNotSaveChanges,OriginalFormat:=wdWordDocument
old man
> 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
[quoted text clipped - 20 lines]
> End Sub
> ====================
MrBill - 06 Jul 2007 14:04 GMT
That worked, thanks Old Man! BTW - how old are you? :)
- MrBill
>Hi,
>
[quoted text clipped - 29 lines]
>> End Sub
>> ====================
Hi,
I am old enough to have bought an original PC (I was already working in IT)
when it was first released.
By the way it is nice to check off a reply as answered if you are satisfied
with the reply.
old man
> 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
[quoted text clipped - 20 lines]
> End Sub
> ====================
Russ - 07 Jul 2007 01:22 GMT
Message in line below.
> Hi,
>
[quoted text clipped - 3 lines]
> By the way it is nice to check off a reply as answered if you are satisfied
> with the reply.
Hey old man,
I'm handling these newsgroups' messages through an email client, so I don't
see so-called ratings boxes or other checkboxes on a website. All I can do
is say "Thanks" as my feedback to other people helping me, which I try to
do. So don't feel bad, if 'my' feedback boxes are unused.
> old man
>
[quoted text clipped - 22 lines]
>> End Sub
>> ====================

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
MrBill - 07 Jul 2007 04:02 GMT
That's not old, I'm old enough to have debugged wired boards on
accounting machines before my shop got a 1401 PC which we programmed
in Autocoder! :) That 1401 was something . . . 16 KB of core, 6
humongous tape drives, lights flashing like crazy, cost $3M, filled a
room, had about 1/1000th the processing power of my current PC. Those
were the good old days . . . NOT!
- MrBill
>Hi,
>
[quoted text clipped - 30 lines]
>> End Sub
>> ====================
I think this would do the trick:
Public Sub CloseAllWindowsAndQuit()
While Application.Windows.Count > 0
With Windows(1)
.Activate
.Close savechanges:=wdDoNotSaveChanges
End With
Wend
Application.Quit
End Sub
That's all!
With kind regards,
W. Kooy
Netherlands
> 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
[quoted text clipped - 20 lines]
> End Sub
> ====================