Let me first explain what I am trying to do. I need to be able to go into a microsoft word document and have a program write into a specific blank what I tell it to write. For instance, lets say I have some info I want to ask someone. In the word document, I will already have a spot that says "Favorite Food: _____" or something like that. In the console that comes up, I need it to say "What is your favorite kind of food?" from which I type pizza. I need that pizza to be entered in the blank.
After I have everything I need entered, I need to be able to connect to my printer downstairs and print it. This is for my personal buisness at home. Can anyone tell me where to even begin? The only thing I know so far is that I am going to need to include iostream for the text... lol.
Ok... Why do I need to know about a file format if I want to just add text onto the end of a sentance in the doc...
"Read: it is probably no easy task." Sounds like sarcasm?
If I do not HAVE to, I don't really want to change to plain text files. I put my logo on all of the sheets that I print out, and there are other tweeks and things that I do to make my contracts look nice for my customers. Unless I can do the same thing somehow in .txts, which I don't believe you can, I'd rather not mess with them.
Playing with Word documents directly is really a very deep, dark, frustrating thing to do.
You can use OLE to use Word itself to modify your document.
You can also use a modified version VBscript in Word itself to manipulate your document. I actually suggest the latter, since you can begin by simply opening word, start recording a macro, do the stuff you need to search and replace a blank with your text, stop recording the macro, then save the macro as a script. You can then directly edit/modify that script to generalize it across a specified search pattern and replacement text.
Alas, Word is a fierce beast to tame, so you've got your work cut out for you either way. But it is doable.