Link to home
Start Free TrialLog in
Avatar of vgopalji
vgopalji

asked on

Read data from word file...

Hi All,

Here, I want to know how to read the data from any MSWord file using VC++. Is this can be acheived using mfc, automation etc. If so, then please explain how to do aceive this?

Thanking You
Venu
Avatar of mblat
mblat

Most important question - do you have MSWord installed on target machine or not?

If yes the easiest route would be automation described on msdn.microsoft.com.

Thare too many links on a subject to be posted here, but I post one.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno97ta/html/msoautovc.asp

hope it helps...
Avatar of DanRollins
Hi vgopalji,
Do you need additional information?
-- Dan
Avatar of vgopalji

ASKER

DanRollins

Thankyou for your response. I need more information regarding accessing/reading data from word file.

venu
Hi vgopalji,
Did you check the page that mblat suggested, in particular, did you look at this link?
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q178784
There is a complete example there.

Please describe what you would like to do once the WORD document is open.  Display it? Search for a particular string of text in it?  Modify it and save it?  

Please provide more details.  Thanks!
-- Dan

Hi DanRollins,
Thanks for the support. I went through the given link and able to access the word page in my application and able to perform the functionalities such as print the word document, priview the page. But, here I am unable to read the data from the word document.
Here, they provided _Document functions like GetSentences(), GetParagraph() & GetWords(). Can I use these functions to retrieve the data. Please, let me know how to proceede further.
Thank You,
Venu
>> ...Can I use these functions to retrieve the data...
Yes.  But a lot depends upon whaat you need to do.

Please describe what you would like to do once the WORD document is open.  Display it? Search for a particular string of text in it?  Modify it and save it?

-- Dan
Hello Dan,

Good.. Here I would like to read and extract the data from word document on to the other storage media or notepad, etc.
Here, I would like to brief my application which is as follows. At present I am working on voice applications, which uses Text-to-Speech(TTS)engine to read out. For the TTS to work it takes a strings/characters/words as the input data. Now I can able to perform the same with HTML/notepad/wordpad data, but it is not the same with Word document, because format is totally different.
So, to acheive this I need to extract the sentences/words from the word document by using your method and later I fed this to my engine.
Hope now  you got my approach. So, please help me how to solve this.

Thanks
Venu
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Dan,

Now, I am running out of the time. From your response the third solution is looks sound and I would like you to help me in that regard. Regarding points I, am flexible and give you good points. So, tell me now how to continue.

W.r.t this project we alredy started some work which is as suggested by you, so now I would like to continue in the same way by using _Document functions such as GetSenetences(), Paragraphs() and word() etc. Hope I am clear from my side and looking forward favourable reply.

Thank You
Venu
>>So, tell me now how to continue
Please re-read my last post.  You will see there some suggestions on how to proceed.  I will not write your program for 100 points, no matter how much time pressure you feel.  Sorry.  If you are having some specific problems, please show the code that is failing and I will  try to analyse it

-- Dan