gpt4 book ai didi

c# - word文档转xml代码c#

转载 作者:太空宇宙 更新时间:2023-11-03 10:38:11 25 4
gpt4 key购买 nike

如何将该word文档转换为如下的xml代码?我有一个word文档模板。将word文档转换为xml代码后,我将我的数据表附加到body标签并生成word文档。请帮忙。在我的应用程序中,没有使用 Interop 或其他一些 dll 来自定义文档的可能性,所以我正在尝试这样。

<html xmlns:o='urn:schemas-microsoft-com:office:office' 
xmlns:w='urn:schemas-microsoft-com:office:word'
xmlns='http://www.w3.org/TR/REC-html40'>
<head><title>Time</title>
<!--[if gte mso 9]>
<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>90</w:Zoom>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>
<![endif]-->
<style>
<!-- /* Style Definitions */
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in ;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;
}
div.Section1 {page:Section1;}
-->
</style>
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1><h1>Time and tide wait for none</h1>
<p style='color:red'><I>10/30/2014 5:37:16 PM</I></p>
</div>
</body>
</html>

最佳答案

OpenXML SDK 2.5

允许您操作 Office 文件。不过,SDK 有点不清楚。

Some help on converting Office files to XML

关于c# - word文档转xml代码c#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26652768/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com