How to load text of MS Word document in C# (.NET)?

calendar_today Asked Oct 18, 2008
thumb_up 4 upvotes
history Updated April 16, 2026

Question posted 2008 · +6 upvotes

How do I load MS Word document (.doc and .docx) to memory (variable) without doing this?:

wordApp.Documents.Open

I don’t want to open MS Word, I just want that text inside.

You gave me answer for DOCX, but what about DOC? I want free and high performance solution – not to open 12.000 instances of Word to process all of them. 🙁 Aspose is commercial product, and 900$ is a way too much for what I do.

Accepted answer +4 upvotes

You can use wordconv.exe which is part of the Office Compatibility Pack to convert from doc to docx.

http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en

Just call the command like so: “C:Program FilesMicrosoft OfficeOffice12wordconv.exe” -oice -nme InputFile OutputFile

I’m not sure if you need word installed for it to run but it does work. I use it locally as a windows shell command to convert old office files to 2007 format whenever I want.

Top ms-word Q&A (6)

+4 upvotes ranks this answer #30 out of 31 ms-word solutions on this site .