john.tm has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; use autodie; use File::Copy; my $errorprn1 = "\n! cannot find printer UK BAS 1ST FLOOR WEST PRN 1 o +n srv00086\n It may be out use, try using UK BAS 1ST FLOOR WEST PRN 2\n"; copy 'C://Temp//test.xls' , '//SRV00086//UK BAS 1ST FLOOR WEST PRN 1' +or die "$errorprn1" ; #my $Word = Win32::OLE->new('Word.Application', 'Quit'); #$Word->{'Visible'} = 1; # if you want to see what's going on #$Word->Documents->Open("C:\\temp\\prn1.doc") #|| die("Unable to open document ", Win32::OLE->LastError()); #$Word->ActiveDocument->PrintOut({ #Background => 0, #Append => 0, #Range => wdPrintAllDocument, #Item => wdPrintDocumentContent, #Copies => 1, #PageType => wdPrintAllPages,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is it possible to print off Exel and Word documents in perl.
by AppleFritter (Vicar) on Jul 08, 2014 at 20:19 UTC | |
|
Re: Is it possible to print off Excel and Word documents in perl.
by davies (Monsignor) on Jul 08, 2014 at 22:16 UTC |