- How to send faxes?
- Programming the sending of faxes
- Sending a fax from a WINDEV application or from a WEBDEV site
- Sending a fax created with the report editor
- Configuring the fax server through programming
- Options of fax server
Sending faxes with WINDEV and WEBDEV
To send faxes from an application or from a site, WINDEV and WEBDEV propose several functions allowing you to send faxes via the system fax server available in Windows XP and Windows 2000.
Remark: In Windows Vista, the management of faxes is available in Windows Vista Professional Edition and Windows Vista Ultimate Edition.
To send faxes from a WINDEV application or from a WEBDEV site, you must:
Programming the sending of faxes
Sending a fax from a WINDEV application or from a WEBDEV site
To send a fax from a WINDEV application or from a WEBDEV site, you must:
- Prepare the fax, which means the file that will be sent. A specific first page (called "Cover page") can also be attached to the fax. This cover page is a ".cov" file and it can be created from the fax server.
- Use the FaxConnect function. This function is used to connect the WINDEV application to the fax server installed on the current computer.
- Send the fax:
- with the FaxSend function. When sending the fax, you have the ability to specify the name of a WLanguage procedure. This procedure will be called whenever the status of the fax is modified by the fax server. The status of the fax is returned by FaxStatus. This function is used to fill the FaxCompleteStatus structure containing the characteristics of the fax.
- with iDestination and the print functions. This solution allows you to directly print a report created with the report editor. In this case, you can give a name to the fax sent. The status of the fax will be returned by FaxStatus. This function is used to fill the FaxCompleteStatus structure containing the characteristics of the fax.
Remark: A single fax can be sent at a time. However, FaxSend can be run several times in a row: the different faxes will be added to the outgoing fax queue. The WLanguage procedure combined with FaxStatus allows you to find out which fax is currently processed. This function is used to fill the FaxCompleteStatus structure containing the characteristics of the fax.
- When the faxes have been sent, all you have to do is disconnect the WINDEV application from the fax server with FaxDisconnect.
Sending a fax created with the report editor
To send a fax created with the report editor, you can:
- use only the iDestination function. The report printed by iPrintReport will be sent to the specified fax number. In this case, you cannot follow the progress of the fax.
// Sends the "RPT_CustInvoice" report by fax
- use Fax functions and iDestination. iDestination establishes (if necessary) a connection to the fax server and returns the identifier of this connection. This identifier can be used by the Fax functions to follow the progress of the send operation.
// Sends the "RPT_CustInvoice" report by fax
ConnectID is int
ConnectID = iDestination(iFax, "0006050402", "MyFax","\\MyFax\FaxPrinter")
// "\\MyFax\FaxPrinter" is the share name of the fax printer
Configuring the fax server through programming
Options of fax server
The standard fax server of Windows proposes several options that can be configured directly from the interface of the fax server. These different options can be configured through programming via the registry. You have the ability to configure and find out:
- information regarding the sending of faxes (Windows 2000):
The corresponding registry key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fax:
|Archive the outgoing faxes||ArchiveOutgoingFax|
|Directory of outgoing faxes||ArchiveDirectory|
|Forbid the custom cover pages||ServerCoverPageOnly|
|Number of attempts||Retries|
|Number of days before deleting the unsent faxes||Dirty Days|
|Number of minutes between two attempts||Retry Delay|
|Print the top header||Branding|
|Time when the economy rate ends||StopCheapTime|
|Time when the economy rate starts||StartCheapTime|
- information regarding the sender of the fax (Windows 2000):
The corresponding registry key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fax\UserInfo:
|Displays the status monitor when sending AND receiving faxes||VisualNotification|
|Number of the fax sender||FaxNumber|
|Status monitor always on the top||AlwaysOnTop|
To create a fax server and manage the redial, we advise you to specify the following options in the fax manager:
- No retry for sending faxes:
- Timeout set to 0 mn between two attempts:
- 0 day for keeping the unsent faxes:
It is possible to consider that a fax whose status changed from FaxStatusInit OR FaxStatusCall to FaxStatusInactive was attempted to be sent once. Then, this fax can be re-sent (it will not be automatically re-sent because "No retry for sending faxes" is set to True).
Unit examples (WINDEV): Sending a fax
This page is also available for…