且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从文本文件中读取并写入c中的word文件

更新时间:2023-02-19 21:22:40

正如Richard所写,C#是一种可能的方式 - 不仅如此,而且是微软为此目的设计的natutarl接口。 (所以没有其他的)



C中的另一种解决方案是写入 RTF格式。
As Richard wrote C# is a possible way - not only, but it is the "natutarl interface" which microsoft designs for such purposes. (So there is no other)

An alternative solution in C is to write in RTF Format which word can read.


Word可以理解许多数据格式。提到了富文本格式。将您的数据文件写为html文件,并创建自己的包含数据的表标记。 Word会毫不费力地阅读它并显示它。



如果你想变得非常疯狂,你可以编写一个XSL处理器,其中规则发出HTML但是是一个非常高级的主题。
Word can understand many data formats. Rich text format was mentioned. Write your data file as html file and create your own table markup containing your data. Word will read this without any trouble and display it.

If you want to get really fancy crazy you can write an XSL processor in which the rules emit the HTML but that is a very advanced topic.