使用来自XML文件的值通过C#程序创建Word文档 [英] Create Word document using values from XML file via C# program
问题描述
我已经预先创建了Word文件。
I have precreated Word file.
我有XML文件。
我想编写C#程序来读取来自的文件XML文件并将它们插入到预先生成的Word文件中。
I would like to write C# program to read values from XML file and insert them into precreated Word file.
C#用于将XML文件中的值插入到预先生成的Word文件中的推荐库是什么?
What is recommended library for C# for inserting values from XML file into precreated Word file?
谢谢。
推荐答案
您好,
我建议您使用Open XML SDK操作你的word文档。
I would like to suggest you to use Open XML SDK to operate your word document.
GitHub上有一个示例:
如何:打开文本并将其添加到文字处理文档(Open XML SDK)
And there is a sample on GitHub: How to: Open and add text to a word processing document (Open XML SDK)
对于读取xml文件的部分,您可以查看以下帖子:
For the part reading your xml file, you might take a look at the following posts:
Hope this will be helpful to you.
这篇关于使用来自XML文件的值通过C#程序创建Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!