none
how can i convert my Word to XMl and back to word RRS feed

  • Question

  • i want to convert my word file to XML and after editing save back to word.

    using C#.net with Word 2007

    is this possible ? if yes. how can i do that ?

    Wednesday, September 28, 2011 12:20 PM

Answers

  • If you mean, how do you find the watermark in a docx file, you need to go to OpenXMLDeveloper.org and possible the Open XML SDK forum. That kind of thing is very specialized and not covered in this forum, which targets the object model.
    Cindy Meister, VSTO/Word MVP
    • Marked as answer by manavya Friday, September 30, 2011 7:36 AM
    Thursday, September 29, 2011 1:13 PM
    Moderator

All replies

  • What kind of XML do you have in mind, specifically?

    A Word 2007 document is already a zip package of xml files. All you'd need is the standard Packaging namespace to unzip, get the document.xml file and work with that. Put it back into the Zip package and, as long as you've edited so the file is still valid WordOpenXML, it would be fine.

    More information at OpenXMLDeveloper.org

    Beyond that, you can save the file (SaveAs) to the Word 2003 XML file format, which is a "flat file" XML but won't contain all the new features of Word 2007.

    There would be some variations on the theme, but any more detailed suggestions would depend very much on exactly what it is you want to do.


    Cindy Meister, VSTO/Word MVP
    Wednesday, September 28, 2011 1:12 PM
    Moderator
  • Thanks you Cindy

    what i want to do is, i need to change the watermark character. so i convert it from word to XML and edit the watermark text.

    after updation, convert back to word.

    But as you said, A Word 2007 document is already a zip package of xml files so, whre do i find them ?

    Thursday, September 29, 2011 11:24 AM
  • If you mean, how do you find the watermark in a docx file, you need to go to OpenXMLDeveloper.org and possible the Open XML SDK forum. That kind of thing is very specialized and not covered in this forum, which targets the object model.
    Cindy Meister, VSTO/Word MVP
    • Marked as answer by manavya Friday, September 30, 2011 7:36 AM
    Thursday, September 29, 2011 1:13 PM
    Moderator