Sending Data (.doc file) to a fax [VC#]

Shaitan00

Junior Contributor
Joined
Aug 11, 2003
Messages
358
Location
Hell
Given a WORD document (C:\FAX.doc), I need to write a program able to send this file to a FAX machine (or possibly a FAX MODEM, there should be a difference).
I have a text file (numbers.txt) which contain a list of fax numbers, I read in from this file to get the required dialer information and want to send a copy of FAX.doc to each in an automated fashion.
The only problem I am having is - how do I send a FAX.DOC (Microsoft Word Document file) to an actual FAX machine?

The application will be designed to work on WindowsXP with a FAX/MODEM attached.
If possible I would like for it to run on Windows2000 also but only if it does not make life any more difficult.

Any help, hints, or ideas would be greatly appreciated - I am not sure where to start, how to create an object to the FAX, and how to send the DATA..?
(btw - not sure if it helps, but I could always convert the .doc to .pdf if it makes life any simpler)
 
Whether you are looking at a .doc or a .pdf, you will need to translate the data into something a fax machine could understand. I can't tell you how to do this, but here are some thoughts. Using interop with Microsoft Office, perhaps it is possible to print to a device context or bitmap rather than an actual printer. You may also be able to find a third party library to do this. From there you can probably find a library, managed or otherwise, that can take the bitmap/DC and send it to a fax machine or a fax modem (I'm guessing that a fax modem would be easier).
 
What about something like:

Code:
using FAXCOMLib;
............

FaxServerClass fs = new FaxServerClass();
fs.Connect(FAXMACHINE); //specifies the machinename
				
FaxDoc fd = (FaxDoc)fs.CreateDocument(FILE_PATH);
fd.FaxNumber = FAXNUMBER;
				
fd.RecipientName = RECEIPIENTNAME;

fd.SenderName =SENDERNAME;
fd.SenderFax = SENDERFAX;
				
int i = fd.Send(); //check i for success or failure

It doesn't seem to be working for me yet (but that might currently have to do with something regarding my FAX/MODEM not appearing as a FAX device in WindowsXP right now ... otherwise I thought it looked promising...
 
Is FAXCOMLib a .Net library? ActiveX? How do you render the data to the fax? Do you have drawing functions? Do you pass an image? Depending on these details, the exact method differs. For instance, I doubt that an ActiveX dll can deal with a System.Drawing.Bitmap, while it might be able to deal with a Windows device context or bitmap (assuming that .Net has no special marshalling for these, which I believe to be the case).
 
Back
Top