i have a richtextbox ,a textbox and a button in c# windows form.i also have a 100 page ms-word .doc file .i want to make an application which displays only that page in richtextbox which is containing the exact word written in textbox. for example: if i write "hello" in textbox and click on search button then richtextbox should display all content of page which is having "hello" word.

Recommended Answers

All 2 Replies

You'll probably have to use COM with Word, aka Word Interop; here's the reference. Note that this requires particular versions of Word to be installed on the client machines. I'm sure there are ways to determine and utilize the version at runtime, although I've never had the need to look into it.

You'll be able to load plain text pretty easily. If you want, you can get formatting information using the Interop libraries; however, it would be pretty near impossible to exactly match the formatting used by Word.

thanx sir it solved my problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.