如果你是2000以上,有一个faxcom的 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 public sub sendFax() Dim objFaxSev As New FAXCOMLib.FaxServer Dim objFaxDoc As FAXCOMLib.FaxDoc Dim strFile As String Dim b As Long objFaxSev.Connect(ComputerName) '出错 strfile = "E:\fax.doc" objFaxDoc = CType(objFaxSev.CreateDocument(strFile), FAXCOMLib.FaxDoc) '出错 objFaxDoc.FaxNumber = "02084083475" b = objFaxDoc.Send() end sub 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
http://www.zarr.net
http://www.vbhelp.bet
http://www.21code.com
http://www.vbthunder.com
http://www.easthot.net
http://www.freevbcode.com
http://www.vbaccelerator.com
http://jinesc.6600.org
http://www.codeguru.com
http://www.vbcode.com
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
public sub sendFax()
Dim objFaxSev As New FAXCOMLib.FaxServer
Dim objFaxDoc As FAXCOMLib.FaxDoc
Dim strFile As String
Dim b As Long
objFaxSev.Connect(ComputerName) '出错
strfile = "E:\fax.doc"
objFaxDoc = CType(objFaxSev.CreateDocument(strFile), FAXCOMLib.FaxDoc) '出错
objFaxDoc.FaxNumber = "02084083475"
b = objFaxDoc.Send()
end sub
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