将 docx 转换为 xlsx

发布于 2024-08-03 13:14:40 字数 168 浏览 1 评论 0原文

我正在编写生成 docx 报告的 .NET 应用程序。我最后的要求之一是 - 还以 xlsx 格式生成这些报告。所以, 有没有简单的方法将 docx 转换为 xlsx 格式?我还没有找到任何解决方案或实用程序/库。想法之一是使用 Microsoft.Office.Interop 复制/粘贴方法,但我不知道它是否有帮助:)

I am writting .NET application that generates reports in docx. One of the last requirements I've got was - generate also these reports in xlsx format. So,
is there any simple way to convert docx to xlsx format? I haven't found any solution or utility/library. One of the ideas was to use Microsoft.Office.Interop Copy/Paste methods, but I don't know if it helps :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浪荡不羁 2024-08-10 13:14:40

我们使用了 MS 工具,让您可以像处理 xml 一样处理 Office 文档:

Open XML SDK 2.0 for Microsoft Office

http://www.microsoft.com/downloads/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang =en

与互操作相比,这具有以下优点:

  • 无需安装 Office
  • 不会因 Excel 未关闭而出现内存问题
  • 性能更好,在我们的示例中,它从 40 秒缩短到 2(两)秒

We have used a MS tool that allows you to work with Office documents as if they were xml:

Open XML SDK 2.0 for Microsoft Office

http://www.microsoft.com/downloads/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en

This had the following benefits compared with interop:

  • No need in install office
  • No problems with memory due to Excel not closing
  • Better performance, in our case it went from 40 seconds to 2 (two)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文