That third line of code should prevent that message from appearing, so I
don't know why it does. You might also try including
wd.ActiveDocument.Saved = True
before it.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I am running some code in Excel to print all Word .doc files in a
>particular folder.
[quoted text clipped - 22 lines]
>
> RBS
RB Smissaert - 26 Oct 2005 21:24 GMT
Thanks; I have seen more people that have come across this in Word 2002 and
the solution was always to do as you suggested, so that should be OK then.
RBS
> That third line of code should prevent that message from appearing, so I
> don't know why it does. You might also try including
[quoted text clipped - 29 lines]
>>
>> RBS
RB Smissaert - 29 Oct 2005 11:25 GMT
I thought that adding wd.ActiveDocument.Saved = True
would have solved this, but unfortunately it hasn't.
Still the same problem.
Any other suggestions?
I will try this code, but I really can't see much difference:
Dim wd As Word.Application
Dim wdDoc As Word.Document
Set wd = New Word.Application
wd.DisplayAlerts = wdAlertsNone
for i = 1 to 100
Set wdDoc = wd.Documents.Open(filename:=arrFiles2(i, 2),
ReadOnly:=True)
With wdDoc
.Saved = True 'to avoid a confirmation in Word 2002 !
.PrintOut Background:=False
.Saved = True 'to make extra sure
.Close wdDoNotSaveChanges
End With
Next
Another thing I would be interested in is how to get the generated error
(Err.Number and Err.Description) from Word if it was run via automation from
Excel.
RBS
> That third line of code should prevent that message from appearing, so I
> don't know why it does. You might also try including
[quoted text clipped - 29 lines]
>>
>> RBS