physi has asked for the wisdom of the Perl Monks concerning the following question:
This little example shows the problem:
use strict; use Win32::OLE::Const 'Microsoft Word'; use Tk; #### my $mw = MainWindow->new; my $file = "c:\\TEMP\\test.doc"; my $Word = Win32::OLE->new('Word.Application', 'Quit'); $Word->Documents->Open($file) || die("Unable to open document", Win32: +:OLE->LastError()); my $last_printer=$Word->{ActivePrinter}; $Word->{ActivePrinter} ='PS2FILE'; $Word->ActiveDocument->PrintOut({ Background => 0, Append => 0, Range => wdPrintAllDocument, Item => wdPrintDocumentContent, Copies => 1, PageType => wdPrintAllPages, }); $Word->{ActivePrinter} = $last_printer; ### MainLoop;
use strict; use Win32::OLE::Const 'Microsoft Word'; use Tk; my $mw = MainWindow->new; my $file = "c:\\TEMP\\test.doc"; my $Word = Win32::OLE->new('Word.Application', 'Quit'); $Word->Documents->Open($file) || die("Unable to open document", Win32: +:OLE->LastError()); my $last_printer=$Word->{ActivePrinter}; $Word->{ActivePrinter} ='PS2FILE'; $Word->ActiveDocument->PrintOut({ Background => 0, Append => 0, Range => wdPrintAllDocument, Item => wdPrintDocumentContent, Copies => 1, PageType => wdPrintAllPages, }); $Word->{ActivePrinter} = $last_printer; MainLoop;
So what's going on here ? Why does this OLE-set-a-Active-Printer Action doesn't work with a Tk widget ?
Any suggestions are very welcome ..
----------------------------------- --the good, the bad and the physi-- -----------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE + Tk BUG ??
by c-era (Curate) on Jun 27, 2001 at 17:42 UTC | |
|
Re: Win32::OLE + Tk BUG ??
by mattr (Curate) on Jun 27, 2001 at 17:25 UTC |