简体   繁体   English

以编程方式将docx文件转换为doc

[英]Programmatically convert docx file to doc

What options do I have to convert .docx documents to .doc document programmatically using C#? 我有什么选择使用C#以编程方式将.docx文档转换为.doc文档? I'm looking to do this as cheaply as possible. 我希望尽可能便宜地做到这一点。 Ideally I want to do this directly in code via libraries within the .net framework or via a well establish downloadable dll. 理想情况下,我希望通过.net框架内的库或通过良好建立的可下载dll直接在代码中执行此操作。

The one constraint we have is that we can't install Office onto our servers. 我们的一个约束是我们无法将Office安装到我们的服务器上。

Consider Aspose.Words . 考虑Aspose.Words It is a high quality product that is fast, reasonably priced and accurate. 它是一种快速,价格合理且准确的高品质产品。 Converting documents from docx to doc, even with Word automation may result in data loss and may impact fidelity. 将文档从docx转换为doc,即使使用Word自动化也可能导致数据丢失并可能影响保真度。 This may be very important to some users. 这对某些用户来说可能非常重要。

I'm not affiliated with their product. 我不隶属于他们的产品。

You need to use Microsoft.Office.Interop.Office and Office assembly to convert the Docx file into Doc programmatically. 您需要使用Microsoft.Office.Interop.OfficeOffice程序集以编程方式将Docx文件转换为Doc。 It is part of Visual studio 它是Visual studio的一部分

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14"

I am not sure internally these dlls are take support from Office. 我不确定内部这些dll是否得到了Office的支持。 But you can try on this.Because I converted Doc to ppt file and it is working fine without Office installation on my Machine. 但你可以尝试这个。因为我将Doc转换为ppt文件,并且在我的机器上没有安装Office的情况下工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM