views:

105

answers:

1

I have multiple <body> tags from an word document. I do this with the open xml sdk. So the new document should generated with openxml

The body's comes from

WordprocessingDocument.Open("C:\Temp\Test.docx").MainDocumentPart.Document.Body.OuterXml

I have so different body's in a list. With al different values. Changed some text in the xml. And saved them in a new list.

Now must that list in an new word document. How can i do that? I tried altChunk. But my word document is always corrupt.

Somebody that can help me?

A: 

You can create a WordDocument using the sdk. I think it's

WordProcessingDocument.Create("path_and_name_with_.docx").MainDocumentPart.Document.append(yourBodyList);

You could also take the resulting documents that don't work and look at it's XML using the SDK tool or just rename the doc to .zip extension and see why it doens't work.

Ingó Vals
It works like this. But i went all the body's in 1 word document. But i solved it by creating more documents
SvenVdb