Thread: MS Word 2007 document reading problem in C

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    21

    Question MS Word 2007 document reading problem in C

    Hi all,
    I'm writing a small C program to read a ms word 2007 document and the read contents i'm trying to display on output screen. The content of this ms word 2007 document"Test_file.doc" is "This is a sample.". Whenever i execute my program it outputs as some japanese characters(see my attachment for the output). I want to know the reason why its so. Could you please tell me anyone? Also how can i correct my program?

    thanks and regards,
    Sri
    Attached Images Attached Images MS Word 2007 document reading problem in C-junk_char-jpg 

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well you could post your program for a start.

    And you also need to understand that .doc files are binary files with a lot more information in them than just the text you type in. Look at the file size for a start, does it make sense to you that it is a lot larger than the 15 or so characters you typed in?

    If you put those characters in a text file using your code editor, then you would have a file which is 15 characters long.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    21
    asdf

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If that's the best you can do, welcome to my ignore list.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Opening link from Word document
    By BobDole in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 02-20-2008, 09:11 AM
  2. Compiling a script that can write information to a word document
    By superflygizmo in forum Game Programming
    Replies: 6
    Last Post: 02-14-2006, 05:27 PM
  3. Replies: 2
    Last Post: 02-14-2006, 11:08 AM
  4. Saving a document using Word COM
    By UnclePunker in forum Windows Programming
    Replies: 16
    Last Post: 04-19-2005, 11:11 AM