Ask a questionAsk a question
 

AnswerHow to create a new Office Doc

  • Wednesday, October 15, 2008 2:42 PMDave Hanna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'm beating my head against the wall thinking "This CANNOT be that hard", but I can't find the answer. 

    I am just getting started with the OpenXml SDK, and I have what should be a simple task: I want to read in a Word Template file (.dotx), perform some manipulations on the content, and write it back out as a new Word document (.docx), with a different file name. Disregard the manipulations for the moment. How do I save the package as a new filename?  All the examples read in a file, perform manipulations,and use XmlDocument.Save to write it back out, but I can't find a way to change the file name that it's written to.  The TargetPath and TargetName properties of the MainDocumentPart are read only, so I can't just change those.

    I appreciate the help.

Answers

All Replies