MS Word 2007 document reading problem in C

This is a discussion on MS Word 2007 document reading problem in C within the C Programming forums, part of the General Programming Boards category; Hi all, I'm writing a small C program to read a ms word 2007 document and the read contents i'm ...

  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  

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,540
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,540
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 08: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, 04:27 PM
  3. Replies: 2
    Last Post: 02-14-2006, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21