Free Support Forum - aspose.com

Loading a Word document in a c# DataTable or any similar Object

hello,

I need to load an Word document file in a Dataset and read the Datatable(s)

From there i'm good to parse the data I need.. do you guys have a way to load the data in DataSet or any other Object.. a c# sample will be gratly appreciated.

Thanks

Sorry, I don't understand the question. How can Word document be loaded to Dataset? As far as I know of all office formats only Excel spreadsheets can serve as a data souce. Maybe I didn't get you right. Please clarify your point.

Best regards,

i need to open and read a word document on our server whitout having word open. Once the document open i need to read data in it by using regular expression, so the question is :

I need to read data from a Word document whitout open Word Office.. actually Word will not be install on that server. So is the solution to open the word document and save it as a text file ??? then parse it to get what i want....

Any code sample will be gratlty appreciated.

Thanks

Hi,

Aspose.Words is exactly a component intended to process Microsoft Word documents without utilizing Microsoft Word itself.

To learn how to open documents, please read the following topic:

http://www.aspose.com/Wiki/default.aspx/Aspose.Words/OpeningOrCreatingDocuments.html

To obtain the text of the document, it is not necessarily to save it as .txt first. You can get it using the Range object. The explantion and code samples related to this method are available here:

http://www.aspose.com/Wiki/default.aspx/Aspose.Words/WorkingWithRange.html

see the Retrieving Plain Text section.

If saving the document as a text file is required, read the following topic:

http://www.aspose.com/Wiki/default.aspx/Aspose.Words/SavingDocuments.html

If you experience any difficulties implementing your solution, don't hesitate to let us know. BTW why do you need to parse the text? Maybe using document model would be a simpler solution in your case?

those it works with rtf file type ???

From your question it is unclear whether you asked about RTF import or export. Exporting to RTF files is supported started from the version 4.0 so you can save your documents to RTF right now. Importing documents in RTF format will be available in around two months.