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

Dear Monks,

How we find formatted content (bold,italic) in word document and replace those text with <b>boldtext</b>

Thanks.

Replies are listed 'Best First'.
Re: Find formatting (bold,italic) in Word document
by Sinistral (Monsignor) on Feb 17, 2009 at 14:19 UTC

    Ah, I get to answer with the same URL from a previous question. You want to use Win32::OLE to start Word, make a selection, delete the formatting, and prepend/append your HTML markup.

    See Word and PERL, the ActivePerl FAQ, and Perl - OLE - Word for some good code to use to start Word. The main thing you'll have to do is figure out the equivalent of the Visual Basic for Applications (VBA) code to do a selection based on formatting

    And, as moritz said, you could simply let Word convert the document to HTML and you won't have to do any programming whatsoever

Re: Find formatting (bold,italic) in Word document
by moritz (Cardinal) on Feb 17, 2009 at 12:51 UTC
    By exporting the document to HTML?