RE: Save As option in Win32::OLE
"Jan Dubois" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <008701c9ef17$8a9a3ce0$9fceb6a0$@com> |
On Tue, 16 Jun 2009, Ramkumar wrote:
>
> I am opening word document through Win32::OLE and saving as Plain Text with
> Encoding option MS-DOS and Insert-Line-Break option.
>
> I achieved the above output through perl, but output not matching with the
> output which is done the same manual operation in MS-word.
>
> My code:
> my $Word = Win32::OLE->new('Word.Application');
> $Word->{'Visible'} = 0;
> $Word->{DisplayAlerts} = 0;
> my $doc = $Word->Documents->Open("$folderpath\\Chapter 1.doc");
> $Word->ActiveDocument->SaveAs({FileName=>"$folderpath\\Chapter
> 1.txt", FileFormat=>wdFormatDOSTextLineBreaks});
> $Word->{ActiveDocument}->Close;
> $doc->Close;
> $Word->Close;
>
> Please correct me if I did any mistake on the above code.
You need to show the complete code. I would suspect that you are not
including the Word constants using Win32::OLE::Const. If you are
using "strict" and "warnings" then you would have been told by Perl.
But without seeing your complete source it is impossible to tell.
You also didn't mention how the script output is different from
the manual output.
Cheers,
-Jan
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs