This ought to work:
Sub AutoNew()
Dim nDoc As Long
For nDoc = Documents.Count To 1 Step -1
If (Documents(nDoc).Type = wdTypeDocument) And _
(Documents(nDoc).AttachedTemplate.Name _
= ThisDocument) Then
MsgBox "This document is based on an " & _
"obsolete template and will close now."
Documents(nDoc).Close _
SaveChanges:=wdDoNotSaveChanges
End If
Next
End Sub
The For loop checks every open document, and closes any that match the
criteria in the If statement.
The check of the document type allows you to open the template itself for
editing without the macro slamming it closed immediately. (I hate when that
happens. <g>)
The other part of the If statement asks whether the attached template (the
one on which the document is based) has the same name as the template that
contains the running macro. It doesn't matter what that name is, as long as
it matches.

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
> Hello everybody
>
[quoted text clipped - 14 lines]
> Word 2000 or Word 2002.
> Thanks in advance for any help you can offer.
fumei - 09 Oct 2007 04:34 GMT
"The check of the document type allows you to open the template itself for
editing without the macro slamming it closed immediately. (I hate when that
happens. <g>)"
Thanks for the laugh Jay. Yup. Yup. That is a pain for sure. Been there.