Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
use Win32::OLE;
use strict;
use Win32::OLE::Const 'Microsoft Word';
my $dir = '/public_html/temp';
my $Word = Win32::OLE->new('Word.Application', 'Quit');
my $original_printer = $Word->ActivePrinter;
$Word->{'ActivePrinter'} = "PDFCreator on NE00:";
sleep 2;
$Word->ChangeFileOpenDirectory("$dir");
chdir "$dir";
while(defined(my $filename = glob("*.doc"))) {
$Word->Documents->Open("$dir/$filename", {'ReadOnly' => 1,}) or die("Can't access file ", Win32::OLE->LastError());
$Word->ActiveDocument->PrintOut({
'Background' => 0,
'Append' => 0,
'Range' => wdPrintAllDocument,
'Item' => wdPrintDocumentContent,
'Copies' => 1,
'PageType' => wdPrintAllPages,
'PrintToFile'=> 0,
# 'OutputFileName' => "c:\\temp2\\$filename.pdf",
});
sleep 1;
$Word->ActiveDocument->{'Saved'} = "True";
sleep 2;
$Word->ActiveDocument->Close({
'SaveChanges' => wdDoNotSaveChanges,
'OriginalFormat' => wdOriginalDocumentFormat,
'RouteDocument' => 0,
});
}
sleep 2;
$Word->{'ActivePrinter'} = "$original_printer";
$Word->Quit();