Platform SDK: Fax Services

FaxDoc Object (Visual Basic)

The FaxDoc object permits a Visual Basic fax client application to transmit fax documents and cover pages, and to retrieve and set information about fax transmissions. Information includes the name of the file to transmit, the fax number to which the fax server should send the fax, cover page settings, and fax recipient and sender information.

The FaxDoc object has the following method and properties:

When to Implement

You should not implement this class. The Microsoft standard implementation provides complete functionality. You can use the Visual Basic Object Browser to view the FaxDoc object's type library information in Visual Basic syntax.

To create a FaxDoc object

  1. Call the Visual Basic CreateObject function to create a FaxServer object.
  2. Call the CreateDocument method of the FaxServer object to create a FaxDoc object.

The following is a Visual Basic method of FaxDoc objects.

Method Visual Basic Example
Send  
Transmits the document specified by the FaxDoc object to the fax number specified by the object.

Dim FD as Object
Dim JobId as Long
JobId = FD.Send()

Values are not required for optional properties that appear only on the cover page. The FileName property is required to send a fax transmission using a call to the Send method. The FaxNumber property is also required, unless you specify the ConnectionObject property.

Following is a list of the Visual Basic properties of FaxDoc objects.

Property Visual Basic Example
BillingCode
STRING
Read/Write
 
Application- or server-specific billing code that applies to the fax transmission. (Billing codes are optional.)
' Retrieve
Dim strBillcode As String
strBillcode = objFaxDoc.BillingCode
' Assign
objFaxDoc.BillingCode = "MyBillingCode"
ConnectionObject
OBJECT
Read/write
 
Optional TAPI 3.0 call object. This object enables transmission of a fax to an active inbound call. This property can be assigned only by reference.

Note that the CallHandle property is available for use only by C/C++ fax client applications. Visual Basic applications cannot use the CallHandle property because Visual Basic cannot make calls to TAPI 2.x functions.

Dim objFaxDoc as Object
Dim objTapiConnection as Object
Dim FileName As String
FileName = "MyFile"
' Create FaxServer object
objFaxDoc = FaxServer.CreateDoc(FileName)
' Assign object reference and
'  create TAPI Connection object
Set objFaxDoc.ConnectionObject = objTapiConnection
CoverpageName
STRING
Read/Write
 
Name of the cover page file to include with the fax document. The property can be the file name only of a common cover page file or a personal cover page file. It can also be the fully qualified path to any other cover page file.

' Retrieve
Dim strCpageName As String
strCpageName = objFaxDoc.CoverpageName
' Assign
objFaxDoc.CoverpageName = "MyCpageName"
CoverpageNote
STRING
Read/Write
 
Text of a message or note from the sender that pertains to the fax transmission. The note can appear on the cover page.
' Retrieve
Dim strCpageNote As String
strCpageNote = objFaxDoc.CoverpageNote
' Assign
objFaxDoc.CoverpageNote = "MyNote"
CoverpageSubject
STRING
Read/Write
 
Subject line of the fax transmission. The subject can appear on the cover page.
' Retrieve
Dim strCpageSubj As String
strCpageSubj = objFaxDoc.CoverpageSubject
' Assign
objFaxDoc.CoverpageSubject = "MySubject"
DiscountSend
LONG
Read/Write
 
Value that indicates whether the fax server should send the fax transmission during the discount rate period. A nonzero value indicates that transmission will be during the discount period. A value of zero indicates that the fax service sends faxes immediately.

' Retrieve
Dim lDiscSend As Long
lDiscSend = objFaxDoc.DiscountSend
' Assign
objFaxDoc.DiscountSend = – 1
DisplayName
STRING
Read/Write
 
User-friendly name to associate with the fax document.
' Retrieve
Dim strDispName As String
strDispName = objFaxDoc.DisplayName
' Assign
objFaxDoc.DisplayName = "MyDisplayName"
EmailAddress
STRING
Read/Write
 
E-mail address of the sender of the fax document.
' Retrieve
Dim strEmailAdd As String
strEmailAdd = objFaxDoc.EmailAddress
' Assign
objFaxDoc.EmailAddress = "MyEmailAddress"
FaxNumber
STRING
Read/Write
 
Fax number to which the fax server will transmit the document. The FaxNumber property is required to send a fax transmission using a call to the Send method of the FaxDoc object, unless you specify the ConnectionObject property.

' Retrieve
Dim strFaxNum As String
strFaxNum = objFaxDoc.FaxNumber
' Assign
objFaxDoc.FaxNumber = "MyFaxNumber"
FileName
STRING
Read/Write
 
Name of the document file to transmit. This property can be any valid local or remote file name. The file must be a properly registered file type, and the fax server must have access to the file. The FileName property is required to send a fax transmission using a call to the Send method of the FaxDoc object.

' Retrieve
Dim strFileName As String
strFileName = objFaxDoc.FileName
' Assign
objFaxDoc.FileName = "MyFileName"
RecipientAddress
STRING
Read/Write
 
Street address of the recipient of the fax document. The address can appear on the cover page.
' Retrieve
Dim strRecAddr As String
strRecAddr = objFaxDoc.RecipientAddress
' Assign
objFaxDoc.RecipientAddress = "MyRAddress"
RecipientCity
STRING
Read/Write
 
City name of the recipient of the fax document. The city can appear on the cover page.
' Retrieve
Dim strRecCity As String
strRecCity = objFaxDoc.RecipientCity
' Assign
objFaxDoc.RecipientCity = "MyRCity"
RecipientCompany
STRING
Read/Write
 
Company name of the recipient of the fax document. The company name can appear on the cover page.
' Retrieve
Dim strRecComp As String
strRecComp = objFaxDoc.RecipientCompany
' Assign
objFaxDoc.RecipientCompany = "MyRCompany"
RecipientCountry
STRING
Read/Write
 
Country name of the recipient of the fax document. The country name can appear on the cover page.
' Retrieve
Dim strRecCoun As String
strRecCoun = objFaxDoc.RecipientCountry
' Assign
objFaxDoc.RecipientCountry = "MyRCountry"
RecipientDepartment
STRING
Read/Write
 
Department identifier of the recipient of the fax document. The department can appear on the cover page.
' Retrieve
Dim strRecDept As String
strRecDept = objFaxDoc.RecipientDepartment
' Assign
objFaxDoc.RecipientDepartment = "MyRDepartment"
RecipientHomePhone
STRING
Read/Write
 
Home telephone number of the recipient of the fax document. The number can appear on the cover page.
' Retrieve
Dim strRecHPhone As String
strRecHPhone = objFaxDoc.RecipientHomePhone
' Assign
objFaxDoc.RecipientHomePhone = "MyRHomePhone"
RecipientName
STRING
Read/Write
 
Name of the recipient of the fax document. The name can appear on the cover page.
' Retrieve
Dim strRecName As String
strRecName = objFaxDoc.RecipientName
' Assign
objFaxDoc.RecipientName = "MyRName"
RecipientOffice
STRING
Read/Write
 
Office location of the recipient of the fax document. The office can appear on the cover page.
' Retrieve
Dim strRecOfc As String
strRecOfc = objFaxDoc.RecipientOffice
' Assign
objFaxDoc.RecipientOffice = "MyROffice"
RecipientOfficePhone
STRING
Read/Write
 
Office telephone number of the recipient of the fax document. The number can appear on the cover page.
' Retrieve
Dim strRecOPhone As String
strRecOPhone = objFaxDoc.RecipientOfficePhone
' Assign
objFaxDoc.RecipientOfficePhone = "MyROfficePhone"
RecipientState
STRING
Read/Write
 
State name or state abbreviation of the recipient of the fax document. The state string can appear on the cover page.
' Retrieve
Dim strRecState As String
strRecState = objFaxDoc.RecipientState
' Assign
objFaxDoc.RecipientState = "MyRState"
RecipientTitle
STRING
Read/Write
 
Title of the recipient of the fax document. The title can appear on the cover page.
' Retrieve
Dim strRecTitle As String
strRecTitle = objFaxDoc.RecipientTitle
' Assign
objFaxDoc.RecipientTitle = "MyRTitle"
RecipientZip
STRING
Read/Write
 
Postal ZIP code of the recipient of the fax document. The ZIP code can appear on the cover page.
' Retrieve
Dim strRecZip As String
strRecZip = objFaxDoc.RecipientZip
' Assign
objFaxDoc.RecipientZip = "MyRZip"
SendCoverpage
LONG
Read/Write
 
Value that indicates whether the fax server should send a cover page with the fax document. A nonzero value indicates that the fax service will include a cover page.
' Retrieve
Dim lSendCpage As Long
lSendCpage = objFaxDoc.SendCoverpage
' Assign
objFaxDoc.SendCoverpage = – 1
SenderAddress
STRING
Read/Write
 
Street address of the sender of the fax document. The address can appear on the cover page.
' Retrieve
Dim strSendAddr As String
strSendAddr = objFaxDoc.SenderAddress
' Assign
objFaxDoc.SenderAddress = "MySAddress"
SenderCompany
STRING
Read/Write
 
Company name of the sender of the fax document. The company can appear on the cover page.
' Retrieve
Dim strSendComp As String
strSendComp = objFaxDoc.SenderCompany
' Assign
objFaxDoc.SenderCompany = "MySCompany"
SenderDepartment
STRING
Read/Write
 
Department identifier of the sender of the fax document. The department can appear on the cover page.
' Retrieve
Dim strSendDept As String
strSendDept = objFaxDoc.SenderDepartment
' Assign
objFaxDoc.SenderDepartment = "MySDepartment"
SenderFax
STRING
Read/Write
 
Fax number of the sender of the outbound fax transmission.

' Retrieve
Dim strSFax As String
strSFax = objFaxDoc.SenderFax
' Assign
objFaxDoc.SenderFax = "MySFaxNum"
SenderHomePhone
STRING
Read/Write
 
Home telephone number of the sender of the fax document. The number can appear on the cover page.
' Retrieve
Dim strSendHPhone As String
strSendHPhone = objFaxDoc.SenderHomePhone
' Assign
objFaxDoc.SenderHomePhone = "MySHomePhone"
SenderName
STRING
Read/Write
 
Name of the sender of the fax document. The name can appear on the cover page.
' Retrieve
Dim strSendName As String
strSendName = objFaxDoc.SenderName
' Assign
objFaxDoc.SenderName = "MySName"
SenderOffice
STRING
Read/Write
 
Office location of the sender of the fax document. The office can appear on the cover page.
' Retrieve
Dim strSendOfc As String
strSendOfc = objFaxDoc.SenderOffice
' Assign
objFaxDoc.SenderOffice = "MySOffice"
SenderOfficePhone
STRING
Read/Write
 
Office telephone number of the sender of the fax document. The number can appear on the cover page.
' Retrieve
Dim strSendOPhone As String
strSendOPhone = objFaxDoc.SenderOfficePhone
' Assign
objFaxDoc.SenderOfficePhone = "MySOfficePhone"
SenderTitle
STRING
Read/Write
 
Title of the sender of the fax document. The title can appear on the cover page.
' Retrieve
Dim strSendTitle As String
strSendTitle = objFaxDoc.SenderTitle
' Assign
objFaxDoc.SenderTitle = "MySTitle"
ServerCoverpage
LONG
Read/Write
 
Value that indicates whether the specified cover page is a common cover page located on the server. A nonzero value indicates that the specified cover page template file (*.cov) is a common cover page file stored on the fax server.

' Retrieve
Dim lServCpage As Long
lServCpage = objFaxDoc.ServerCoverpage
' Assign
objFaxDoc.ServerCoverpage = – 1
Tsid
STRING
Read/Write
 
User-defined transmitting station identifier (TSID) to associate with the fax transmission.
' Retrieve
Dim strTsid As String
strTsid = objFaxDoc.Tsid
' Assign
objFaxDoc.Tsid = "MyTsid"