in reply to Opening word file in open office

OpenOffice::OODoc can handle only files in the OpenOffice format. MS Word is a completely different format. OpenOffice::OODoc is not OpenOffice (which can read MS Word documents).

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: Opening word file in open office
by soubalaji (Sexton) on Jun 27, 2009 at 14:03 UTC
    Hi,

    If the OpenOffice::OODoc will not read the word files means, any other source to read the word file. Now we are moving to open source.
        Yes martin i posted the question but no reply.
        Hi The example at OpenOffice::UNO which u mentioned is compleatly useless. I understood nothing. What I would need is a real example which uses OpenOffice::UNO to open a Word-document and saves it as odt-document. If anyone could post such code this would be really cool!! Alex

      There still is no Perl module written to read the various MS Word formats on CPAN, but OLE::Storage has an example script that extracts text from MS Word 6/7/8 files, so OLE::Storage should be able to read MS Word files, but maybe not on that high level that OpenOffice::OODoc offers. The newer OLE::Storage_Lite should also be able to read MS Word files. There is also a module that can WRITE MS Word files (Win32::Word::Writer), but it depends on OLE and an installed MS Word. Newer MS Office versions (starting at Office 2003) write ZIP-compressed XML files for at least Word, Excel, and Powerpoint. You just have to unzip the *.docx file and parse the XML file it contains, very similar to what OpenOffice::OODoc does. See also Re: Excel 2007 Support.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)