Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#Create filenames $file =~ s/(.*)\.fin/$1/i; $file = $1; my $fileName = "$file.rtf"; my $fileName2 = "$file.doc"; #Convert to RTF my $doc = Win32::OLE->new('Word.Application', 'Quit'); $doc->Documents->Open($path); $doc->ActiveDocument->SaveAs({FileName => $fileName, FileFormat => wdF +ormatRTF}); #Close Winword $doc->Quit(); undef $doc; #Run pretty print macro and save as word doc format my $doc1 = Win32::OLE->new('Word.Application', 'Quit'); $doc1->Documents->Open($path); $doc1->ActiveDocument->Run("psqtemplate"); $doc1->ActiveDocument->SaveAs({FileName => $fileName2}); # Close Winword $doc1->Quit(); undef $doc1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE running macros
by wfsp (Abbot) on May 07, 2005 at 07:42 UTC | |
by Anonymous Monk on May 09, 2005 at 14:37 UTC | |
by Anonymous Monk on May 09, 2005 at 15:05 UTC |