Using the COM Implementation in a Visual Basic Program
The following steps summarize typical programming tasks required to incorporate the functionality of the Fax Service Client API in a Microsoft Visual Basic fax client application if you are using the Component Object Model (COM) implementation.
To code a fax client application
Create an instance of a FaxServer object by calling the Visual Basic CreateObject function. Then connect to an active fax server by calling the Connect method of the object. For more information, see Connecting to a Fax Server.
To create other objects you need, call one or more of the following methods of the FaxServer object.
- To create a FaxJobs object, call the GetJobs method. Use this object to create FaxJob objects and enumerate the fax jobs associated with the connected fax server.
- To create a FaxPorts object, call the GetPorts method. Use this object to create FaxPort objects and enumerate fax port configuration information for the connected fax server.
- To create a FaxDoc object, call the CreateDocument method. Use this object to transmit a fax and to retrieve and set the properties of FaxDoc objects.
After creating an instance of a FaxPort object for a specific port, create a FaxRoutingMethods object by calling the GetRoutingMethods method of the object.
Create a FaxRoutingMethod object by calling the Item method of the FaxRoutingMethods object. The FaxRoutingMethod object allows you to query and modify the fax routing information for a fax port. For more information, see Managing Fax Routing Data.
Create a FaxStatus object by calling the GetStatus method of the FaxPort object. The FaxStatus object allows you to provide real-time status information about a fax port.
After creating an instance of a FaxDoc object, transmit a fax document by calling the Send method of the object. Note that the application must supply transmission information such as the fax number and the name of the file to transmit. The client can also supply other data that appears on the cover page by setting various properties of the FaxDoc object. For more information, see Transmitting Faxes.
Terminate the connection to the fax server by calling the IFaxServer::Disconnect method of the FaxServer object. For more information, see Disconnecting from a Fax Server.
In addition, the application may need to set other properties and call other methods to query device or server configuration data and to manage fax jobs. You may also need to create an instance of a FaxTiff object to retrieve information about a file the fax service has sent or received.
For more information, see Fax Server Configuration Management, Fax Device Management, Managing Fax Jobs, and General Fax Client Programming Tasks.
For more information about creating and deallocating fax client objects, see the Fax Service Client API Visual Basic Reference and the hierarchical diagram included in The Fax Client Object Model.