in reply to To Read and Edit docx files in Windows 7

Hmm, rather than the version of Windows, you should tell us the MS Office version you are using. Modern versions of MS Office produce files which are actually compressed (zipped) XML files. So you have to be prepared to edit XML files. I haven't tried it personally, but it seems that simply unzipping a .docx file makes it possible to access the individual XML files.

Otherwise, you could also try to use MSWord::ToHTML and see if it fits your purposes.

  • Comment on Re: To Read and Edit docx files in Windows 7

Replies are listed 'Best First'.
Re^2: To Read and Edit docx files in Windows 7
by DVCHAL (Novice) on Dec 10, 2014 at 12:18 UTC
    Thanks for the reply Laurent. I am using MS office 2010. I need to read and edit from .Docx files. As you told about edit XML files, I am not familiar with that. any Example or reference to work on .docx files would be of great help.
      I've just created a short Word document called December_12.docx and copied it on a Unix platform. Then made a copy of it called December_12.zip. Then, unzipping it shows this:
      $cp December_12.docx December_12.zip $unzip December_12.zip Archive: December_12.zip inflating: [Content_Types].xml inflating: _rels/.rels inflating: word/_rels/document.xml.rels inflating: word/document.xml inflating: word/theme/theme1.xml inflating: word/settings.xml inflating: word/webSettings.xml inflating: word/stylesWithEffects.xml inflating: docProps/core.xml inflating: word/styles.xml inflating: word/fontTable.xml inflating: docProps/app.xml
      Now you could in principle edit the word/document.xml document, except that the XML looks quite messy: The content of the Word document was only these two lines:
      December 12, 2014. The quick brown fox jumps over the lazy dog.
        Thanks for the Sample Laurent. Any way to Extract the Content from XML file through Perl Script? In your Example, How to Extract only "The quick brown fox jumps over the lazy dog" through the perl Script from the messy XML file. Even if its a Table, whether we able to read in XML?