File streaming problem
-
I'm new to MFC and started developing applications just a few months back. I'm trying to build an application using which I can read a word document and get the information that I need. Can anyone tell me how can I perform simple file operation on a word document similar to text files like Getline()? Something similar to C or C++ file operations. :) Thanks, Gajendra
-
I'm new to MFC and started developing applications just a few months back. I'm trying to build an application using which I can read a word document and get the information that I need. Can anyone tell me how can I perform simple file operation on a word document similar to text files like Getline()? Something similar to C or C++ file operations. :) Thanks, Gajendra
-
I'm new to MFC and started developing applications just a few months back. I'm trying to build an application using which I can read a word document and get the information that I need. Can anyone tell me how can I perform simple file operation on a word document similar to text files like Getline()? Something similar to C or C++ file operations. :) Thanks, Gajendra
It is not that easy. A word document has a very specific format and you won't be able to read it like that. You need to go for Word automation (search this site or google or MSDN to learn how it works).
Cédric Moonen Software developer
Charting control -
I don't know that the doc format is well documented. I'd suggest using Word through COM to read / write the files, though this will require that Word be installed on the same machine as your program. earl
earl wrote:
though this will require that Word be installed on the same machine as your program
AFAIK, you don't need to install word on the target computer. Just a simple dll (don't remember its name) will be ok.
Cédric Moonen Software developer
Charting control -
I'm new to MFC and started developing applications just a few months back. I'm trying to build an application using which I can read a word document and get the information that I need. Can anyone tell me how can I perform simple file operation on a word document similar to text files like Getline()? Something similar to C or C++ file operations. :) Thanks, Gajendra
I would opt for Word's COM interface, but if you really want to navigate the file yourself, the format of some of the older versions of Word can be found here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
It is not that easy. A word document has a very specific format and you won't be able to read it like that. You need to go for Word automation (search this site or google or MSDN to learn how it works).
Cédric Moonen Software developer
Charting controlCedric Moonen wrote:
It is not that easy. A word document has a very specific format and you won't be able to read it like that. You need to go for Word automation (search this site or google or MSDN to learn how it works). Cédric Moonen Software developer
I checked the MSDN library online and I could find some Stream operations but they are not very clear to me.:confused: CFile cFile(TEXT("File.rtf"), CFile::modeRead); Can I use this class functions to perform operations successfully? Well it seems so...
-
I would opt for Word's COM interface, but if you really want to navigate the file yourself, the format of some of the older versions of Word can be found here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
Hi David, I'm not aware of COM :(( Please suggest something else... If this is the best then I'll have to get on with it.:~
-
Cedric Moonen wrote:
It is not that easy. A word document has a very specific format and you won't be able to read it like that. You need to go for Word automation (search this site or google or MSDN to learn how it works). Cédric Moonen Software developer
I checked the MSDN library online and I could find some Stream operations but they are not very clear to me.:confused: CFile cFile(TEXT("File.rtf"), CFile::modeRead); Can I use this class functions to perform operations successfully? Well it seems so...
I said that you have to look for 'Word automation'. Did you read my post :confused: ? I never spoke about Stream operation. What I suggested you is exactly the same as the other suggested: using a COM interface for Word (it's just another word for the same thing). You won't be able to read the file if you don't know how it is structured. And I don't think you know (neither do I)
Cédric Moonen Software developer
Charting control -
I said that you have to look for 'Word automation'. Did you read my post :confused: ? I never spoke about Stream operation. What I suggested you is exactly the same as the other suggested: using a COM interface for Word (it's just another word for the same thing). You won't be able to read the file if you don't know how it is structured. And I don't think you know (neither do I)
Cédric Moonen Software developer
Charting controlThanks Cedric !! I'll gather more information and then probably I'll ask specific questions. Gajendra
-
Hi David, I'm not aware of COM :(( Please suggest something else... If this is the best then I'll have to get on with it.:~
gajendrakashyap wrote:
I'm not aware of COM
a.k.a. Outlook Automatioon.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
I would opt for Word's COM interface, but if you really want to navigate the file yourself, the format of some of the older versions of Word can be found here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
Hi David, It would be a great help if you could give me a clear idea how to go about this. Probably names of those interfaces and some help on using them. Tips ... Thanks, Gajendra
-
Hi David, It would be a great help if you could give me a clear idea how to go about this. Probably names of those interfaces and some help on using them. Tips ... Thanks, Gajendra
See here, and then click the "Visual C++/MFC - Information and Sample Code" link. There's also MSDN articles like Q220911, Q261997, Q222101, Q196776, Q192348.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
See here, and then click the "Visual C++/MFC - Information and Sample Code" link. There's also MSDN articles like Q220911, Q261997, Q222101, Q196776, Q192348.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
Hi David, All this is going to help me a lot. I will try to work out on these sample codes. I could not find the last article Q192348. Thanks much for the help. Regards, Gajendra
-
Hi David, All this is going to help me a lot. I will try to work out on these sample codes. I could not find the last article Q192348. Thanks much for the help. Regards, Gajendra
gajendrakashyap wrote:
I could not find the last article Q192348.
Q192348[^] You'll note that some of those articles are for Excel. That's not because I think Word is synonymous with Excel, I just wanted to give you other Automation examples.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
gajendrakashyap wrote:
I could not find the last article Q192348.
Q192348[^] You'll note that some of those articles are for Excel. That's not because I think Word is synonymous with Excel, I just wanted to give you other Automation examples.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
Yes I could find articles on word, powerpoint, excel, outlook etc. Not a problem as I can use excel also for my project. We've made a program in VB that reads excel and gives the output we need. We're working to refine it. I think MFC would also be great at work. Thanks, Gajendra