Reading word file in c#


















This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Is this page helpful? Please rate your experience Yes No. Any additional feedback? We may have used FileStream to read text from a text file but not the same way for getting text from a word document.

We have to use Word. ApplicationClass to have access to the word application. Open the word document in memory, copy all the content to the clipboard and then we can take the data from the clipboard. The code required is given below: Word. Value; Word. Open ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj ; doc. WholeStory ; doc.

GetDataObject ; txtFileContent. GetData DataFormats. ToString ; doc. Close ;. Posted Feb pm anup choudhari. Add your solution here. OK Paste as. Treat my content as plain text, not as HTML. Existing Members Sign in to your account. Does anyone how know to successfully read an word document? Many thanks. Tuesday, December 1, AM. ReleaseComObject wordApp ; Best regards, Bessie Please remember to mark the replies as answers if they help and unmark them if they provide no help.

If you have any feedback, please tell us. Wednesday, December 2, AM. Hi Shubha! This is not the right forum to post the question. This is all abt sql sever database mirroring. Load Server. MapPath "Document.

GetChildElements true, ElementType.



0コメント

  • 1000 / 1000