Printing some *.doc files with the c language under windows 2k

F

fr7456bg

i have many word documents, with the *.doc extension,
they are all in the same directory, suppose
"C:\\test1\\annfjf.doc",
"C:\\test1\\iibiikg.doc",
"C:\\test1\\fv56v44v.doc"

i would like to print them all, with a small program
written in c, but i don't know anything about sending
a list of files to the printer.

I use windows 2K proff. SP4.
Borland 5.5 free compiler.

Would You Please address me in the right direction?

Best Regards.
Mario.
Italy.
 
D

Default User

i have many word documents, with the *.doc extension,
they are all in the same directory, suppose
"C:\\test1\\annfjf.doc",
"C:\\test1\\iibiikg.doc",
"C:\\test1\\fv56v44v.doc"

i would like to print them all, with a small program
written in c, but i don't know anything about sending
a list of files to the printer.

I use windows 2K proff. SP4.
Borland 5.5 free compiler.

This is all platform dependent. It sounds like a Borland group might be
a good place to start. I don't know the exact name of any of them off
the top of my head.




Brian
 
O

osmium

i have many word documents, with the *.doc extension,
they are all in the same directory, suppose
"C:\\test1\\annfjf.doc",
"C:\\test1\\iibiikg.doc",
"C:\\test1\\fv56v44v.doc"

i would like to print them all, with a small program
written in c, but i don't know anything about sending
a list of files to the printer.

I use windows 2K proff. SP4.
Borland 5.5 free compiler.

Would You Please address me in the right direction?

Look at the system() call in <stdlib.h>
 
C

CBFalconer

i have many word documents, with the *.doc extension,
they are all in the same directory, suppose
"C:\\test1\\annfjf.doc",
"C:\\test1\\iibiikg.doc",
"C:\\test1\\fv56v44v.doc"

i would like to print them all, with a small program
written in c, but i don't know anything about sending
a list of files to the printer.

I use windows 2K proff. SP4. Borland 5.5 free compiler.

Would You Please address me in the right direction?

Are you saying those are NOT word files? Word files are not text,
they have some sort of complex binary format, which may include
some text sections.

If you can write a program that processes one file, it is easy to
process them all. Just pass the list in the run command, such as:

printem file1.doc file2.doc ... filen.doc

and revise the single file printem command (which was born as
printing only one file) to do:

FILE *f;
int i;

i = 1;
while (argc > i++) {
if (!(f = fopen(argv))
printf("Can't open %s\n", argv);
else {
printone(f);
fclose(f);
}
}

(I think I have something mixed up above, but you get the idea).
Modify the pre-existing printem code to receive an opened text
file, rather than a file name, and call it the function printone.
The command line is a powerful tool.
 
K

Keith Thompson

CBFalconer said:
Are you saying those are NOT word files? Word files are not text,
they have some sort of complex binary format, which may include
some text sections.

No, he explicitly said that they're word documents.

[snip]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top