0

For a project we need to build some sort of mail merging with Word documents. I prefer this without Word automation. I recall that there is a way to create a .docx file (sort of template) for your letters that you can then just load with the packaging API and add a data file to (e.g. XML). The person who then opens that file will see the letter merged with that data.

Does anyone know if that method actually exist and how to do it?

4

3 回答 3

1

不。即使是 Office Open XML SDK 也不提供。

您将需要推出您拥有或使用一些现有的库。例如:模板程序。免责声明:我是作者。

于 2012-01-09T14:54:27.817 回答
0

试试http://www.codeproject.com/KB/office/Fill_Mergefields.aspx

它使用 Open XML SDK 在 Microsoft Word 文档中查找 MERGEFIELD,并将其替换为提供的数据。

它还有一些约定,如果遵循这些约定,可以提供额外的功能。

于 2012-01-13T21:22:26.453 回答
0

JODReportsDocmosis可以使用提供邮件合并功能的 DOC 格式文件 - 最终结果是您的数据合并的文档。您需要安装 OpenOffice 或 LibreOffice。转换是合理的,您可以选择 DOC 格式以外的输出。他们不使用自动化,可以在多个平台上运行。

于 2012-05-17T08:00:26.347 回答