views:

244

answers:

3

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

+2  A: 

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.

Jeremy Wiebe
A: 

Here is a resource on automating office applications: Office Object Models

phi