none
Use dotx file to assign template to docx in VS2010 using OpenXML SDK RRS feed

  • Question

  • Let me try to explain my overall goal after trying to put all important information into the title. What I'm doing is merging several docx files using altchunk and working me through the xml file.

    I can't figure out how to apply a *.dotx file to my merged documents to apply a overall template, which provides footer, header and so on. If needed I could apply the template first before merging all the other docx files, but I'm really stuck with this.

    If I'm missing any important information, please let me know.

    Thursday, July 29, 2010 2:55 PM

Answers

  • As I couldn't find a way to programmatically set the path to the template I ended up creating a docx from my template manually and use the docx from that point on.
    Monday, August 9, 2010 7:28 AM

All replies

  • Hi Andreas

    I'm going to move this message to the Open XML SDK forum, but before I do, just an observation...

    The Word application's Template functionality does not "plug things" into documents after-the-fact. A document must be generated from a template in order to inherent content. Once a document is created, it can use tools stored in the attached template, such as Ribbon tabs/groups, macros and Building Blocks. But that's all.


    Cindy Meister, VSTO/Word MVP
    Thursday, July 29, 2010 3:41 PM
    Moderator
  • Hey Cindy,

    thanks for your reply. It already cleared up a lot for me around this topic, but I guess my next question is: How can I generate a word document via Open XML SDK from a template? I couldn't find a single code example how to do that. I got the dotx and the docx available.

    Friday, July 30, 2010 7:41 AM
  • As I couldn't find a way to programmatically set the path to the template I ended up creating a docx from my template manually and use the docx from that point on.
    Monday, August 9, 2010 7:28 AM