harryC has asked for the wisdom of the Perl Monks concerning the following question:

Hello I am using this code to print out rtf documents with word under windows to the default printer

use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; use Win32::OLE qw(in with); use Win32::OLE::Variant; sub wordprinterout{ my $filetoopen= shift @_; my $aantal= shift @_; #word open my $Word = Win32::OLE->new('Word.Application', 'Quit'); #$Word->{'Visible'} = 1; # if you want to see what's going on my $printer1 = $Word->{ActivePrinter}; $Word->Documents->Open("$filetoopen") or Carp::croak (print "unable to open document", Win32::OLE->LastError()); my $doc1 = $Word->{ActiveDocument}; $Word->ActiveDocument->PrintOut( Background => 0, Append => 0, Range => wdPrintAllDocument, Item => wdPrintDocumentContent, Copies => $aantal,<br/> PageType => wdPrintAllPages}); #$Word->ActiveDocument->PrintOut; unlink $filetoopen; }
now we want to move from office to openoffice (we like open source)
Does anyone knows the code to do the same thing with openoffice
I thank you for your help in advance

2006-07-17 Retitled by Corion, as per Monastery guidelines
Original title: 'Openoffice'

  • Comment on Moving from MS Office OLE code to Openoffice for printing RTF documents
  • Download Code

Replies are listed 'Best First'.
Re: Moving from MS Office OLE code to Openoffice for printing RTF documents
by gellyfish (Monsignor) on Jul 17, 2006 at 09:49 UTC
Re: Moving from MS Office OLE code to Openoffice for printing RTF documents
by Ieronim (Friar) on Jul 17, 2006 at 16:54 UTC
    Maybe it's simpler to print files using the command-line interface to OpenOffice?

    It allows to do it without loading the GUI, and i think that spawning a process wouldn't cost very much.


         s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print
    A reply falls below the community's threshold of quality. You may see it by logging in.