> Hello,
>
[quoted text clipped - 8 lines]
> What is the scope of macro variables? Is it possible that they are
> common and running the macro simultaneously might overwrite the values?
Hi Nik,
The problem is probably not the scope of the variables, but rather of the
fact that changing the ActivePrinter property changes the system default
printer, and so the default printer may be changed by a competing thread
before another thread can successfully execute the PrintOut method.
Word is an awfully large program to be attempting to run multiple instances
simultaneously. I would recommend that you find a way of having the Java
threads chare a single instance of Wor, perhaps be passing the print jobs to
a single queue which then handles control of Word.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Nik - 04 Jan 2005 10:53 GMT
> Word is an awfully large program to be attempting to run multiple instances
> simultaneously. I would recommend that you find a way of having the Java
> threads chare a single instance of Wor, perhaps be passing the print jobs to
> a single queue which then handles control of Word.
Yes, I'm leaning towards that option. OLE could be one option but then
I would have to use a Java-COM bridge and introduce another external
component to the system and it could become a bottleneck if it hangs.
Another option would be to have a single queue and spawn word instances
from there - hardware is cheap nowadays ;-)
Peter - 05 Jan 2005 19:30 GMT
> Yes, I'm leaning towards that option. OLE could be one option but then
> I would have to use a Java-COM bridge and introduce another external
> component to the system and it could become a bottleneck if it hangs.
If you decide to use OLE, check out jacob, a GPL-licensed Java-COM bridge:
http://sourceforge.net/projects/jacob-project/
I use it extensively for desktop integration with an application that runs as a Java applet.
It can be confusing to use, so be sure to get the examples from
http://geekatwork.net/jacob/
hth,
-Peter