简体   繁体   中英

Convert .doc to .docx with c#

I got a bunch (10k+) of documents, it's actually not only .doc but also .ppt and .xls files that needs to be converted to docx, pptx and xlsx. I am to upload these documents to SharePoint and have an environment with SharePoint, Visual Studio, Office 2010 Pro and so on.

Are there any best practices to perform this? I've been looking a bit at Aspose.Words but 2500 usd seems a bit over the top for a one time conversion.

You have to use microsoft interop dll and you need to have ms office2007 or 2010. its more or less the safest way of doing. but as you are saying 10K+ docs, it will take lots of time. its a three step process. open file. save as file and close file looped over all your files. You can take help of the links provided in answers.

您可以在c#中以自动化方式使用Word(和PowerPoint), 这里作为起点 ,您可以在旧文件之间循环并以编程方式调用新格式的保存。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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