别的控件也可以!!!
解决方案 »
- 替老马升三星散分
- 请问如何用vb调用windows的默认邮件程序?例如outlook、foxmail等
- 求此数学方程式用VB怎么解达.
- 用vb如何将execl中某一单元格的内容送入access中
- 用vb如何自建smtp服务器?
- 达人进,关于控件旋转的api
- 菜鸟问题!怎么把输入到Textbox中的数字转换成可以计算的数字?急救!
- 关于数据库即时查询的问题!!在线等待,!!!
- mshflexgrid 如何设置带区,如何设置伸缩
- .ocx、.dll注册问题!:(
- 100分:详细讲出ActiveX DLL 与Active Control 这两个new project有什么不同。
- Grid总行数问题?
Option Explicit
Private FS As New FAXCOMLib.FaxServer
Private FD As New FAXCOMLib.FaxDoc
Private Const MAX_COMPUTERNAME_LENGTH As Long = 31
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
' ·¢ËÍ´«Õæ·½·¨£¬´«ÈëÒ»¸ö·¢ËÍÎļþ·¾¶£¬»¹ÓÐÄ¿±êºÅÂë
' Dim tmpFaxFile As String
' tmpFaxFile = App.Path & "\LastFax.doc"
' m_CrReport.ExportOptions.FormatType = crEFTExactRichText
' m_CrReport.ExportOptions.DestinationType = crEDTDiskFile
' m_CrReport.ExportOptions.DiskFileName = tmpFaxFile
' m_CrReport.DisplayProgressDialog = False
' m_CrReport.Export False
' frmFax01.SendDoc = tmpFaxFile
' frmFax01.ShowForm
Public Function SendFax(SendDocPath As String, SendNumber As String) As String
On Error GoTo Err_Conn
FS.Connect (ComputerName) ' My Computer's name
On Error GoTo Err_Catch
Set FD = FS.CreateDocument(SendDocPath)
FD.FileName = SendDocPath
FD.FaxNumber = SendNumber ' Fax number
FD.DisplayName = SendNumber
FD.DiscountSend = 0
FD.SendCoverpage = 0
FD.Send
Err_Catch:
GoTo ExitFunc
Err_Conn:
GoTo ExitFunc
ExitFunc:
If Err.Description <> "" Then
SendFax = Err.Description
Else
SendFax = "0"
End If
On Error Resume Next
FS.Disconnect
End Function
Public Function Init() As String
' ³õʼ
On Error GoTo Err_Catch
FS.Connect (ComputerName) ' My Computer's name
Init = "0"
GoTo ExitFunc
Err_Catch:
Init = "³õʼ´«Õæ»úʧ°Ü,ÇëÈ·¶¨ÊÇ·ñ×°Óд«Õæ»ú"
Debug.Print Err.Description
ExitFunc:
End Function
Private Property Get ComputerName() As String
Dim dwLen As Long
Dim strString As String
dwLen = MAX_COMPUTERNAME_LENGTH + 1
strString = String(dwLen, " ")
GetComputerName strString, dwLen
strString = Left(strString, dwLen)
End Property