ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Managing faxes
  • Overview
  • 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
  • Tips
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Sending faxes with WINDEV and WEBDEV
Overview
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.
How to send faxes?
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:
  1. 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.
  2. Use the FaxConnect function. This function is used to connect the WINDEV application to the fax server installed on the current computer.
  3. 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.
  4. 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
    iDestination(iFax, "0006050402")
    iPrintReport(RPT_CustInvoice)
  • 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
    iPrintReport(RPT_CustInvoice)
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 faxesArchiveOutgoingFax
    Directory of outgoing faxesArchiveDirectory
    Forbid the custom cover pagesServerCoverPageOnly
    Number of attemptsRetries
    Number of days before deleting the unsent faxesDirty Days
    Number of minutes between two attemptsRetry Delay
    Print the top headerBranding
    Time when the economy rate endsStopCheapTime
    Time when the economy rate startsStartCheapTime
  • information regarding the sender of the fax (Windows 2000):
    The corresponding registry key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fax\UserInfo:
    Billing codeBillingCode
    Business addressOffice
    Business phoneOfficePhone
    CompanyCompany
    DepartmentDepartment
    Displays the status monitor when sending AND receiving faxesVisualNotification
    Full nameFullName
    Home phoneHomePhone
    Mailbox addressMailbox
    Number of the fax senderFaxNumber
    Sound notificationSoundNotification
    Status monitor always on the topAlwaysOnTop
    TitleTitle

Tips

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:
    RegistrySetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fax","Retries",0)
  • Timeout set to 0 mn between two attempts:
    RegistrySetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fax","Retry Delay",0)
  • 0 day for keeping the unsent faxes:
    RegistrySetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fax","Dirty Days",0)
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).
Related Examples:
Sending a fax Unit examples (WINDEV): Sending a fax
[ + ] Sending a fax with WINDEV. The fax can be sent via a fax server or via a modem properly installed and configured on the user computer.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help