Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
Can anybody tell me, how I can work with MS Word files (search text in it, write,create) in Pure C/Masm in Windows? May be somebody have example, part of code, etc.

What I have tried:

I don't trying anything, because i don't know how to start..
Posted
Updated 6-May-18 9:59am

The way is to write your own parser for those file formats...
And here the catch - DOC is a private (Microsoft owned) format, that never been released to the public...
DOCX is an open domain format...
All this means that you can not write a reliable parser for DOC, but can for DOCX...
For DOCX check these:
Office Open XML - Wikipedia[^]
[MS-DOCX]: Word Extensions to the Office Open XML (.docx) File Format[^]
 
Share this answer
 
You did not want a library, but maybe the source code of this library might be of interest to you: GitHub - DocxFactory/DocxFactory: Cross platform C/C++ library with C#, Java, Python, Progress 4GL wrappers and command line tools for generating Microsoft Word .DOCX (OpenXML) files[^]
It can be used with C and other languages.
 
Share this answer
 
v2
Quote:
how I can work with MS Word files (search text in it, write,create) in Pure C/Masm in Windows?

If you don't want to use existing libraries, you have to recreate them, it is worth a few years of work.
Quote:
i don't know how to start.

First, you need to find the files formats specifications (there is more than 1 version), unfortunately, .doc file formats are not public, so just finding them may be difficult if you are not the best friend of Bill Gates.
Once you got them, plan at least a year to fully understand them.
In other words, it is not reasonable to do what you want.

Since .docx are embedded into a .eip file format, you also need to recreate a .zip library.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900