Word Template, populate fields, C# .NET

大兔子大兔子 提交于 2019-12-06 07:18:48

You can make xpath data bindings in a .docx document. A .docx file is just a zipped file in the Office Open XML which can be opened in .Net without third-party libraries.

http://msdn.microsoft.com/en-us/library/system.io.packaging.package.open.aspx

And you can then supply the .docx file with a XML file in your own format. Then the only thing you have to do is to edit the embedded XML file and not the document itself. See:

http://blogs.msdn.com/b/mikeormond/archive/2008/06/20/word-2007-content-controls-databinding-and-schema-validation.aspx

http://blogs.msdn.com/b/acoat/archive/2007/03/01/linking-word-2007-content-controls-to-custom-xml.aspx

And a custom tool to do the bindings:

http://dbe.codeplex.com/

You could properly also use some .Net interaction with Word itself but I can't help you with that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!