R
Rudy Van Eeckhout
Hello all,
I do have several perl scrips whicht opens by ole an word instance
which is used to print a document to a certain printer. Now we noted
that these documents sometimes appear on the wrong printer. After some
investiation is did seen next effect.
First assume next script
my $Word= Win32::OLE->CreateObject('Word.Application', 'Quit');
$openWord->{'Visible'} = 0;
$Word->{ActivePrinter} = "$printer";
<STDIN> ; #Wait for a cariage return
print $Word->{ActivePrinter} ."\n" ;
When i run this script with $printer set to printerA and i do wait to
give a cariage return until i did run the script in a second form with
$printer set to printerB. The both script will print as active printer
printerB. This means that the assingment of Activeprinter is done for
all instances which are running.
Even when you try this manualy by opening 2 word sessions you can see
that the printer changes over the different sessions.
If you start msword from the command line with the /w option the
problem disapears.
Now i can not find out how to do this over perl OLE.
Is there anybody who knows how to sole this over OLE?
Kind regards.
Rudy.
I do have several perl scrips whicht opens by ole an word instance
which is used to print a document to a certain printer. Now we noted
that these documents sometimes appear on the wrong printer. After some
investiation is did seen next effect.
First assume next script
my $Word= Win32::OLE->CreateObject('Word.Application', 'Quit');
$openWord->{'Visible'} = 0;
$Word->{ActivePrinter} = "$printer";
<STDIN> ; #Wait for a cariage return
print $Word->{ActivePrinter} ."\n" ;
When i run this script with $printer set to printerA and i do wait to
give a cariage return until i did run the script in a second form with
$printer set to printerB. The both script will print as active printer
printerB. This means that the assingment of Activeprinter is done for
all instances which are running.
Even when you try this manualy by opening 2 word sessions you can see
that the printer changes over the different sessions.
If you start msword from the command line with the /w option the
problem disapears.
Now i can not find out how to do this over perl OLE.
Is there anybody who knows how to sole this over OLE?
Kind regards.
Rudy.