Hi Sergey,
Thanks again,
It seem to work but do you have an explaination why Word would get visible?
>Hi Luc,
>
>In test i Word 2003 with your code I see Word flashing during printing. Closing the document after printing seems to keep Word invisible.
loWord.Documents.Open(lcDocument,,1)
> loWord.Printout(0)
> loWord.ActiveDocument.Close(0)
>
>
>
>>I'm currently using Word automation to print barcoded document. When trying to print the subsequent copies, Word gets visible.
>>
>>I think I narrowed it down to the Document.Open() but I don't see why Word become visible after the second loop.
>>
>>In this example I reopen the same document many time, I have also tried re-using one instance of the document and got the same result.
>>
>>Any idea or workaround are welcome.
>>
>>Sample code to reproduce :
>>
>>
>>lcDocument = GETFILE()
>>
>>loWord = CREATEOBJECT([Word.Application])
>>
>>FOR lni=1 TO 3
>> loWord.Documents.Open(lcDocument,,1)
>> loWord.Printout(0)
>>ENDFOR
>>
>>loWord.Quit(0)
>>
Luc Nadeau
lnadeau@neova.ca"the theory, it is when all is known and that nothing works. The practice, it is when all works and that nobody knows why." - Albert Einstein (Nobel of physique 1921)