'Fax Service Client API for Windows 2000 'The Fax Service Client application programming interface (API) allows you to incorporate basic fax functionality for users in client applications. This technology is available on computers that are running Microsoft Windows 2000 and later. ' 'The fax service for Windows XP introduces the Fax Service Extended COM implementation objects. New fax features are supported in the Fax Service Extended COM API, not in the Fax Service Client API for Windows 2000. New fax client applications should use the extended COM interfaces rather than the C/C++ functions or COM interfaces that shipped with the Windows 2000 Platform SDK. ' 'The Fax Service Client API for Windows 2000 includes both Win32 functions and an implementation of COM dual interfaces. ' 'About this overview ' 'The first part of this overview outlines the tasks an application can perform using the Fax Service Client API, and the components you need to support its functionality. It also describes in detail the security features the fax service provides. Finally, it provides a brief discussion about fax ports, fax transmissions, cover pages, and fax routing methods. ' 'The second section addresses differences between fax client applications that run in the Win32 environment and those that run in the COM implementation environment. It also discusses the fax service client functions, the COM dual interfaces, and the following related programming tasks: ' 'Connecting to a fax server 'Fax server configuration management 'Fax device management 'Managing fax routing data 'Transmitting faxes 'Managing fax jobs 'Freeing fax resources 'Disconnecting from a fax server 'For more information, see Fax Client API Programming Tasks and the Fax Service Client API Reference. ' 'You should be familiar with the Telephony Application Programming Interface (TAPI) Programmer's Reference and the Microsoft Telephony Service Provider (TSPI) Programmer's Reference before you read this overview. If you plan to use the fax client COM implementation, you should also be familiar with COM (the Component Object Model) and Automation programming concepts.'Author by StupidWolf
Dim objFaxServer As New FAXCOMLib.FaxServerDim bConnect As BooleanPrivate Sub Command1_Click()
Dim objFaxDoc As New FaxDoc
Set objFaxDoc = objFaxServer.CreateDocument(App.Path & "\NewFax.doc")
我是在winXP下直接安装传真打印机
需要传真是把打印机选择为传真打印机即可
但我想发送数据到传真机上,是我的程序有问题?还是其他原因?
constring = "尊敬的家长,您好!这是您孩子的在校情况"
Allstring = constring + TextInfo.Text
length = Len(Allstring)
Sum = 0 '记录累计发送的字节数
bsize = MSComm1.OutBufferSize '每次发送的块大小
'ReDim SendArray(1 To bsize)
'Do While Sum
'If Sum < length Then'当CTS线及CD线为高电平时才可发送,否则需等待。
'T = Timer + 60
'L:
'MsgBox "测试1-你准备发送数据"If MSComm1.CTSHolding And MSComm1.CDHolding Then
MSComm1.Output = Allstring '发送
Sum = Sum + bsize '累加计数
Label2.Caption = Str(Sum) '显示在发送窗口上Else
'If Timer Then GoTo L '循环等待
MsgBox "测试2-你正在发送数据"
GoTo Sendmsg '等待时间超过60秒则退出
End If
'End If
'等待系统处理完
'Do Until MSComm1.OutBufferCount = 0
'Loop
'Loop '循环语句结尾
Sendmsg:
MsgBox "连接超时,请重试或与管理员联系"
Dim objFaxDoc As FaxDoc
Dim lst As Integer
Set objFaxDoc = objFaxServer.CreateDocument(FileName)
If txtName.Text <> "" And txtFax.Text <> "" Then
objFaxDoc.BillingCode = txtBillingCode.Text
objFaxDoc.CoverpageName = cboCoverPage.Text
objFaxDoc.DiscountSend = IIf(optImmediatelySend.Value, 0, 1)
objFaxDoc.DisplayName = FileTitle
objFaxDoc.RecipientName = txtName.Text
objFaxDoc.FaxNumber = contry + area + txtFax.Text
objFaxDoc.SenderAddress = pi.Address
objFaxDoc.SenderCompany = pi.Company
objFaxDoc.SenderFax = pi.Fax
objFaxDoc.SenderHomePhone = pi.HomePhone
objFaxDoc.SenderName = pi.Name
objFaxDoc.SenderOffice = pi.Office
objFaxDoc.SenderOfficePhone = pi.OfficePhone
objFaxDoc.EmailAddress = pi.Email
'send fax doc
objFaxDoc.Send
End If
'The Fax Service Client application programming interface (API) allows you to incorporate basic fax functionality for users in client applications. This technology is available on computers that are running Microsoft Windows 2000 and later.
'
'The fax service for Windows XP introduces the Fax Service Extended COM implementation objects. New fax features are supported in the Fax Service Extended COM API, not in the Fax Service Client API for Windows 2000. New fax client applications should use the extended COM interfaces rather than the C/C++ functions or COM interfaces that shipped with the Windows 2000 Platform SDK.
'
'The Fax Service Client API for Windows 2000 includes both Win32 functions and an implementation of COM dual interfaces.
'
'About this overview
'
'The first part of this overview outlines the tasks an application can perform using the Fax Service Client API, and the components you need to support its functionality. It also describes in detail the security features the fax service provides. Finally, it provides a brief discussion about fax ports, fax transmissions, cover pages, and fax routing methods.
'
'The second section addresses differences between fax client applications that run in the Win32 environment and those that run in the COM implementation environment. It also discusses the fax service client functions, the COM dual interfaces, and the following related programming tasks:
'
'Connecting to a fax server
'Fax server configuration management
'Fax device management
'Managing fax routing data
'Transmitting faxes
'Managing fax jobs
'Freeing fax resources
'Disconnecting from a fax server
'For more information, see Fax Client API Programming Tasks and the Fax Service Client API Reference.
'
'You should be familiar with the Telephony Application Programming Interface (TAPI) Programmer's Reference and the Microsoft Telephony Service Provider (TSPI) Programmer's Reference before you read this overview. If you plan to use the fax client COM implementation, you should also be familiar with COM (the Component Object Model) and Automation programming concepts.'Author by StupidWolf
Dim objFaxDoc As New FaxDoc
Set objFaxDoc = objFaxServer.CreateDocument(App.Path & "\NewFax.doc")
MsgBox "BillingCode:" & objFaxDoc.BillingCode & _
vbCrLf & "CoverpageName:" & objFaxDoc.CoverpageName & _
vbCrLf & "CoverpageNote:" & objFaxDoc.CoverpageNote & _
vbCrLf & "CoverpageSubject:" & objFaxDoc.CoverpageSubject & _
vbCrLf & "DiscountSend:" & objFaxDoc.DiscountSend & _
vbCrLf & "DisplayName:" & objFaxDoc.DisplayName & _
vbCrLf & "EmailAddress:" & objFaxDoc.EmailAddress & _
vbCrLf & "FaxNumber:" & objFaxDoc.FaxNumber & _
vbCrLf & "FileName:" & objFaxDoc.FileName & _
vbCrLf & "RecipientAddress:" & objFaxDoc.RecipientAddress & _
vbCrLf & "RecipientCity:" & objFaxDoc.RecipientCity & _
vbCrLf & "RecipientCompany:" & objFaxDoc.RecipientCompany & _
vbCrLf & "RecipientCountry:" & objFaxDoc.RecipientCountry & _
vbCrLf & "RecipientDepartment:" & objFaxDoc.RecipientDepartment & _
vbCrLf & "RecipientHomePhone:" & objFaxDoc.RecipientHomePhone & _
vbCrLf & "RecipientName:" & objFaxDoc.RecipientName & _
vbCrLf & "RecipientOffice:" & objFaxDoc.RecipientOffice & _
vbCrLf & "RecipientOfficePhone:" & objFaxDoc.RecipientOfficePhone & _
vbCrLf & "RecipientState:" & objFaxDoc.RecipientState & _
vbCrLf & "RecipientTitle:" & objFaxDoc.RecipientTitle & _
vbCrLf & "RecipientZip:" & objFaxDoc.RecipientZip & _
vbCrLf & "SendCoverpage:" & objFaxDoc.SendCoverpage, vbInformation, "FaxDoc"
MsgBox "SenderAddress:" & objFaxDoc.SenderAddress & _
vbCrLf & "SenderCompany:" & objFaxDoc.SenderCompany & _
vbCrLf & "SenderDepartment:" & objFaxDoc.SenderDepartment & _
vbCrLf & "SenderFax:" & objFaxDoc.SenderFax & _
vbCrLf & "SenderHomePhone:" & objFaxDoc.SenderHomePhone & _
vbCrLf & "SenderName:" & objFaxDoc.SenderName & _
vbCrLf & "SenderOffice:" & objFaxDoc.SenderOffice & _
vbCrLf & "SenderOfficePhone:" & objFaxDoc.SenderOfficePhone & _
vbCrLf & "SenderTitle:" & objFaxDoc.SenderTitle & _
vbCrLf & "ServerCoverpage:" & objFaxDoc.ServerCoverpage & _
vbCrLf & "Tsid:" & objFaxDoc.Tsid, vbInformation, "FaxDoc"
'send a fax
'objFaxDoc.Send
Set objFaxDoc = NothingEnd Sub