简体   繁体   English

MailMerge - Excel(数据)到 Word(模板) - 使用 OpenXML

[英]MailMerge - Excel (data) into Word (template) - With OpenXML

I tried a lot of time to fine a simple and elegane way to do a mailmerge by openXML.我尝试了很多时间来完善一种简单而优雅的方式来通过 openXML 进行邮件合并。

Am I supposed to work through the XML file?我应该通过 XML 文件工作吗? Or is it another way?或者是另一种方式? I have seen several different solutions, but none have given me a comlete solution.我见过几种不同的解决方案,但都没有给我一个完整的解决方案。 (I need the TAMPLATE to be duplicated by the amount of data. For example, if I have 300 rows in Excel, and I have one page in the WORD template - I need it will be duplicated to 300 pages). (我需要将 TAMPLATE 按数据量复制。例如,如果我在 Excel 中有 300 行,并且我在 WORD 模板中有一页 - 我需要将它复制到 300 页)。

Does anyone have a complete solution?有人有完整的解决方案吗?

Thank you谢谢

If you decided to use OpenXML SDK then you should realize that everything is done through XML with it.如果您决定使用 OpenXML SDK 那么您应该意识到一切都是通过 XML 完成的。 In other words, you should be accustomed to XML manipulation if you're going with this path.换句话说,如果你走这条路,你应该习惯于 XML 操作。 Nevertheless, you could check out DocumentAssembler module from OpenXML SDK PowerTools , it should help you out with this task.不过,您可以从OpenXML SDK PowerTools查看DocumentAssembler模块,它应该可以帮助您完成这项任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM