How to convert doc to docx using open xml sdk in c#

夙愿已清 提交于 2019-12-07 08:44:19

问题


Please help me to convert .doc file to .docx using open xml sdk or any other method except word automation.

Thanks in advance.


回答1:


The OpenXML SDK allows you to manipulate only .docx files, not .doc. Here's a blog post illustrating how to perform bulk conversions of .doc to .docx files using a bulk conversion utility. I am afraid that if you don't want to use Word Automation, you will have to write your own .doc parser which might be quite a work.




回答2:


I haven't used it, but take a look at http://b2xtranslator.sourceforge.net/.

In addition, if your scenario supports it, and if your business needs allow for it, it sometimes is effective to install a copy of SharePoint Server 2010, and use Word Automation Services. Some people install a copy of SharePoint Server 2010 just to run Word Automation Services. Word Automation Services has the capability of doing unattended server-side conversion of DOC to DOCX.

Depending on your scenario, Word Automation can be very troublesome. In addition, if you are using Word Automation to serve specific functionality to a set of customers, then there may be licensing considerations. Note that Word Automation is a different technology from Word Automation Services. See http://blogs.msdn.com/b/ericwhite/archive/2010/12/07/what-is-the-difference-between-word-automation-and-word-automation-services.aspx for more info.



来源:https://stackoverflow.com/questions/6489592/how-to-convert-doc-to-docx-using-open-xml-sdk-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!