Group: microsoft.public.word.vba.general
From: =?Utf-8?B?Qko=?=
Date: Thursday, March 13, 2008 2:23 PM
Subject: Word Macro Code Failed when run it thourgh a template

Hi List,

I have a word template. once user entered a date, the code will check to
decide wheter need to add new logos to the file. for doing this, the macro
needs to open another file which contians the new logos, then copy over to
the file, then close the logo file.

when i ran the macro step though clicking F8. it works fine. but when i
tried to run it like a user would be, the macro failed becasue the code
actully didn't close the logo file.

since it works fine when i debugging it, i really can't find the problem.

can someone please help?

here is the code how i close the docs other than the template:

If Windows.Count > 1 Then
For I = Windows.Count To 1 Step -1
Windows(I).Activate
If ActiveDocument.Name <> thisDoc Then
ActiveDocument.ActiveWindow.Close
End If
Next I
End If

Thenks