简体   繁体   中英

Programatically converting from MS word to Excel

Is there anyway to problematically take a MS Word file and convert to excel. (Obviously, word would to guess where to put stuff). Any language would be fine

That's a pretty wide-open question. The content of the Word document will affect how easy/hard this is.

One method you could look at is using Word automation to open the Word document and then write out a new file using comma-separated format and just name the file with a .xls extension. Upon opening this file up in Excel it should "just work".

If you need rich formatting in your output Excel document, you could use Excel automation to build your output document. Using this you'd have both Word automation (read) and Excel automation (write) in your program.

Another option that I've used (but it's a bit pricey) in a server environment is the Aspose libraries Aspose . They have a pretty nice API (at least for Word, which is what I've used) and they eliminate the automation angle.

这是有关使Office应用程序自动化的资源: Office对象模型

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