WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Miscellaneous

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Use Winbatch as a Simple Fax Program

Keywords:    Fax Program

Question:

Does anybody know of a way to write a simple fax program. All it would have to do is send a file to a certain fax number. I've been playing around with the serial extenders, but have no idea how to send a fax once connected. Perhaps it has something to do with sending a binary bytes, but I wouldn't know which bytes to send. Any ideas would be greatly appreciated.

Answer:

  1. Although throretically it may be possible to do with the serial extender, its not likely to be a good idea.

    Mostly the object has to be converted to a TIF image, then *somehow* portions of the TIF image set to the remote computer, The serial extender is supposed to be able to do this, but it is likely to be a rather large task to get all the bits lined up and to understand the fax modem specs to the point where a fax can be sent.

    I would put it more in the category of a thesis in data communications rather than a doable script.

    I recommend some third part faxing utility that you could run from WinBatch.

    However, if you have nothing else to do, you could start by trying to find the definitions of the bits that have to cross the phone wire to send the faxes.

    Then either figure out how to make WinBatch make a tif image (slow and hard) or find a program that can make a tif image for you.

  2. I was involved in a similar project a few months back, found the only realistic way I could do it was to use the printer extender to change the default printer to our fax software (which is setup exactly like a printer and listed in printers), open the file in notepad, use the control manager to handle the who and where of the fax software and to send the fax thru the fax software, then change the default printer back to what it originally was, lastly close notepad.

  3. We user RightFax as our fax software, and it's even simpler.

    RightFax has a "queue" folder on it's server. All we have to do is FileCopy the text file into this folder and it gets faxed.

    There are some commands you embed into the text that tell it who to fax to, etc...

    (Of course, this only sends plain text faxes. I don't know how I'd send a picture.)

  4. At http://msdn.microsoft.com under the MSDN Library there is information for the Microsoft FAX SDK.

    Win2K has a built-in FAX service that is set up as a printer driver. All windows applications can use the printer driver to send a FAX. However, the FAX service is also supposed to be callable directly as a set of API functions in a DLL and/or via COM [e.g. the FAX service interface is an OLE server]. The MSDN Library information regarding the FAX SDK should have sample code. It will most likely be VB code, but that can usually be adapted to WinBatch with only a modest effort. Here a sample UDF that seems to work on Windows 2000.

    #DefineFunction sendFax(filespec, number)
    	; NOTE: As with the Windows address book, the fax number should be in
    	; Microsoft's "canonical" format:
    	; +Country/RegionCode (AreaCode) SubscriberNumber
    	; Spaces, dashes and parentheses are ignored.
    	objfax = ObjectCreate(`FaxServer.FaxServer`)
    	objfax.Connect(yourServerName)
    	; Note: Your machine's network name seems to work for yourServerName 
    	objfaxDoc = objfax.CreateDocument(filespec)
    	objfaxDoc.FileName = filespec
    	objfaxDoc.FaxNumber = number
    	objfaxDoc.Send()
    	objfax.Disconnect()
    	objfaxDoc = 0
    	objfax = 0
    #EndFunction ; sendFax 
    
    

Article ID:   W15179
File Created: 2005:07:05:07:34:16
Last Updated: 2005:07:05:07:34:16