Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Returning the font size from a .txt and .doc

Posted on 2003-03-05
Medium Priority
Last Modified: 2013-12-03
Hi all,

Am trying to write a piece of C code that will return the font size of a word in either a .txt file or a .doc file.

My code so far reads each word as a string and then outputs the number of times this word appears in the file in occurnace order.

As to now have had very little luck and would really appreciate any advice or sample code that someone has.

Thanks very much in advance.

Also does anyone know if functions written in C can be incorporated into a Visual Basic program!!?
Question by:tay_highfield

Accepted Solution

gj62 earned 200 total points
ID: 8073687
A TXT file does not have fonts associated with it, it will display the text in whatever the default font is for the application that opens the file.

If by .DOC file, you mean a Microsoft Word file, Microsoft changes the binary (.DOC) format with each release.  I'm sure there're some tools out there to read it, but I don't know of any.  A quick Google search turned up this, which describes the 6.0 format in detail:


You can write functions in C, compile them into a DLL, and use them in any language that can access a DLL.

Author Comment

ID: 8089516
Hi gj62,

Thanks for the help. Think i will leave this problem as it sounds like i am out of my depth. Will try this problem again when my C programming skills have improved.

Thanks again for the help.
LVL 20

Expert Comment

ID: 10058915
Nothing has happened on this question in more than 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by gj62.


EE Cleanup Volunteer

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question