通过WordProcessingML修改结构后是否可以访问word文档? http://officeopenxml.com/anatomyofOOXML.php
我需要不直接使用 C# 将表格添加到 word 文档,而是将 xml 注入 C#。数据来自以下方法中的列表。我必须使用这些数据并结合非常大的 xml 标记来构建整个表。
- 创建一个带有“hello world”字符串的word文档并保存它,比如说example.docx。
- 将 example.docx 重命名为 example.zip 以将其转换为 zip 文件
-解压zip文件并删除example.zip,解压后你会看到3个文件夹(_rels,docProps,word),文件夹名称“word”包含document.xml文件
-修改document.xml文件而不是“Hello World”说“Hello W4rld”并将整个文件夹重新压缩为example.zip,然后将扩展名从example.rar更改为example.docx
打开 example.docx 给出错误。有人知道吗?
Public static string Method1(List<class> list)
{
//foreachloop
// Build table structure with xml(wordprocessingML)
// Use StringBuilder to append this large xml table structure.
return list.Tostring()
}