locked
How to generate docx RRS feed

Answers

All replies

  • User1508394307 posted
    1. Do you mean that you save xml content with .docx extension?
    2. What happens if you open your file in Word 2010, save as a new .docx document, will it be opened in Word 2003?
    Tuesday, October 29, 2013 9:48 AM
  • User-1644805496 posted

    1. I dont save  but using Response i push the xml content into a temp doc with .docx extension.

    2. Yes ,I can open a Word 2010 , saved as .docx in Word 2003 machine.

    but a Word 2010  Xml document, saved as .xml when opened in word 2003 machine i get unwanted tags.

    Wednesday, October 30, 2013 5:37 AM
  • User1508394307 posted

    I think that the problem here is that you send an xml content and tell that it's a file with .docx extension. In fact, docx is more than just xml and that's the reason why you get xml structure instead of document. 

    You can try to play with MIME type and set instead of application/msword one of the following values

    application/vnd.ms-word.document.12
    application/vnd.openxmlformats-officedocument.wordprocessingml.document

    or 

    text/xml

    In case of Response.ContentType="text/xml" you might tell that extension is ".xml" and not ".docx"

    Additionally, check an article here at http://msdn.microsoft.com/en-us/magazine/cc164064.aspx regarding xml docs.

    Let me know if it helps.

    In general, OpenXML can create real docx using WordprocessingDocument.Create(), so if you will not find any solution with xml, try to change the way you create documents.

    Wednesday, October 30, 2013 6:05 AM
  • User-1644805496 posted

    When i tried to generate .docx, I used the below MIME type

    application/vnd.ms-word.document.12
    application/vnd.openxmlformats-officedocument.wordprocessingml.document

    even then i get unwanted tags when opened in 2003 and unable to open in 2010 it throws error

    i have XML file in flat opc format.. i want to convert it into .docx format.

     

     

     

    Friday, November 1, 2013 8:17 AM
  • User1508394307 posted

    Use WordprocessingDocument.Create() and similar methods.

    Read more here http://msdn.microsoft.com/en-us/library/office/ff478190.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, November 2, 2013 5:49 PM