How to read a MS Word file ( .doc ) file from C program 
Author Message
 How to read a MS Word file ( .doc ) file from C program

How to read a MS Word file ( .doc ) file from C program.
Give me the sample program where I can read the .doc file from a C
language program. Is it the same as .txt or .dat file? How to get
special character (like a tab)?


Mon, 20 Dec 2004 15:08:29 GMT  
 How to read a MS Word file ( .doc ) file from C program
You should not even begin to try to manually parse a .doc file unless you
know anything about compound documents and OLE. Look on MSDN for structured
storage. There are special Win32 APIs for opening compound docs like MS Word
or Excel.


Quote:
> How to read a MS Word file ( .doc ) file from C program.
> Give me the sample program where I can read the .doc file from a C
> language program. Is it the same as .txt or .dat file? How to get
> special character (like a tab)?



Mon, 20 Dec 2004 15:12:15 GMT  
 How to read a MS Word file ( .doc ) file from C program

Quote:
> How to read a MS Word file ( .doc ) file from C program.
> Give me the sample program where I can read the .doc file from a C
> language program. Is it the same as .txt or .dat file? How to get
> special character (like a tab)?

C language will let you open the file and read in a stream of data. How
you interpret that data is up to you. If you know that the data is a
Microsoft Word document you will need to understand the format of a Word
document and process the data as you read it in. For example, the format
information for Word documents might say things like, the first eight
bytes will always be 0xd0 0cf 0x11 0xe0 0xa1 0xb1 0x1a 0xe1. In which case
I would code my program to confirm the first eight bytes match this
value. If they do not I report the document is not a Microsoft Word
document.

Bottom line is that you need to understand the format of the Word document
to be able to read it with just standard C. You might want to go to a
newsgroup that supports programming in the Microsoft environment. There is
probably a library of functions you can use to achieve your goal. Even if
the library does not exist you will need the people knowledgable in the
Word format to help you.

---

"iqgbgxmdbjlgdv.lksrqek.n";char *strchr(const char *,int); while
(*i){j+=strchr(t,*i++)-t;j%=sizeof t-1;putchar(t[j]);}return 0;}



Tue, 21 Dec 2004 21:52:42 GMT  
 How to read a MS Word file ( .doc ) file from C program

Quote:

> How to read a MS Word file ( .doc ) file from C program.

Have a look at http://www.wotsit.org/ and after reading
something about the format either try to write a C-program
to parse it or forget it entirely. ;-)

Jirka



Tue, 21 Dec 2004 22:07:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Read property of MS-Word file from Visual C++ program

2. Newbie: separate big .cs file into small .cs files

3. Read property of MS-Word file from VC5.x

4. How to read a file word by word?

5. how copy Doc file to new Doc file?

6. File->New in doc/view doesn't clear doc file name

7. View MS Word Doc in a modeless dialog when the parent window of the dialog is a MS Word Doc window

8. Converting word .doc file into .tif image format

9. How to save a file in Microsoft word format(.doc) or Rich text format

10. resx files needed for cs - files ??

11. CS files display in VS6 like CPP files ?

12. Help files(rtf) and new MS Word

 

 
Powered by phpBB® Forum Software