2

I'm having a Perl script which saves a Word document as a HTML one. The following code works:

use strict;
use Win32::OLE::Const 'Microsoft Word';
[...]
$go_word_doc->SaveAs2({
    FileName => $gs_html_name,
    FileFormat => wdFormatFilteredHTML
    });

In order to encode the output file in UTF-8, I wrote this:

use strict;
use Win32::OLE::Const 'Microsoft Word';
use Win32::OLE::Const 'Microsoft Office [0-9.]+ Object Library';
[...]
$go_word_doc->SaveAs2({
    FileName => $gs_html_name,
    FileFormat => wdFormatFilteredHTML,
    Encoding => msoEncodingUTF8
    });

The code runs, but the generated file is not properly encoded.

I then wonder how to proceed. I read about using WebOptions but I cant' find how to address them.

Could anyone help, please? Thanks in advance.

JNM
  • 125
  • 9

0 Answers0