Duplicating Word document using OpenXml and C#

前端 未结 6 1794
野趣味
野趣味 2020-12-06 06:27

I am using Word and OpenXml to provide mail merge functionality in a C# ASP.NET web application:

1) A document is uploaded with a number of pre-defined strings for s

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 06:58

    When you look at an openxml document by changing the extension to zip and opening it you see that that word subfolder contains a _rels folder where all the relations are listed. These relations point to the parts you mentioned (style ...). Actually you need these parts because they contain the definition of the formatting. So not copying them will cause the new document to use the formatting defined in the normal.dot file and not the one defined in the original document. So I think you have to copy them.

提交回复
热议问题