各位大大,我在msdn上找到了一個faxserver的範例程式經過測試後可以傳送資料 那我想要也寫一個可以接收資料的程式 但找了很多還是找不到一些相關的資料 那以下程式碼是找到的傳送程式,請大大給我的方向或是哪裡有參考資料能夠讓我做個參考
(我是使用VB撰寫,因為這裡沒有VB 討論區所以張貼於此)
Dim FaxDocumentObj As New FAXCOMEXLib.FaxDocument
Dim FaxServerObj As New FAXCOMEXLib.FaxServer
Dim JobIDObj As Variant
Private Sub Command1_Click()
'Error handling.
On Error GoTo Error_Handler 'Connect to the fax server.
FaxServerObj.Connect "" 'Set the fax body.
FaxDocumentObj.Body = "D:\VB\1txt" 'Name the document.
FaxDocumentObj.DocumentName = "First Fax" 'Set the fax priority.
'FaxDocumentObj.Priority = fptHIGH 'Add the recipient with the fax number 2065552626.
FaxDocumentObj.Recipients.Add (Text1.Text), "
" 'Choose to attach the fax to the fax receipt.
FaxDocumentObj.AttachFaxToReceipt = True 'Set the cover page type and the path of the cover page.
'FaxDocumentObj.CoverPageType = fcptSERVER
FaxDocumentObj.CoverPage = "generic" 'Provide the cover page note.
FaxDocumentObj.Note = "This contains the information you requested." 'Provide the address for the fax receipt.
FaxDocumentObj.ReceiptAddress = "someone@example.com" 'Set the receipt type to e-mail.
'FaxDocumentObj.ReceiptType = frtMAIL 'Specify that the fax is to be sent at a particular time
'FaxDocumentObj.ScheduleType = fstSPECIFIC_TIME
'CDate converts the time to the Date data type
FaxDocumentObj.ScheduleTime = CDate("6:25:12 PM") FaxDocumentObj.Subject = "Today's fax" 'Set the sender properties.
FaxDocumentObj.Sender.Title = "Mr."
FaxDocumentObj.Sender.Name = "吳禮吉"
FaxDocumentObj.Sender.City = "Sender_City"
FaxDocumentObj.Sender.State = "Sender_State"
FaxDocumentObj.Sender.Company = "Sender_Company"
FaxDocumentObj.Sender.Country = "Sender_Country"
FaxDocumentObj.Sender.Email = "someone@somewebsite.com"
FaxDocumentObj.Sender.FaxNumber = "4255550167"
FaxDocumentObj.Sender.HomePhone = "4255550987"
FaxDocumentObj.Sender.OfficeLocation = "My_Location"
'FaxDocumentObj.Sender.OfficePhone = "4255550334"
FaxDocumentObj.Sender.StreetAddress = "123 Main Street"
FaxDocumentObj.Sender.TSID = "Office Fax"
FaxDocumentObj.Sender.ZipCode = "44118"
FaxDocumentObj.Sender.BillingCode = "23A54"
FaxDocumentObj.Sender.Department = "Accts Payable" 'Save sender information as default.
FaxDocumentObj.Sender.SaveDefaultSender 'Submit the document to the connected fax server, and retrieve the job ID. JobIDObj = FaxDocumentObj.ConnectedSubmit(FaxServerObj) MsgBox "The Job ID is :" & JobIDObj(0)
Exit Sub Error_Handler:
'Implement error handling at the end of your subroutine. This implementation is for demonstration purposes
MsgBox "Error number: " & Hex(Err.Number) & ", " & Err.Description
End Sub (欲做成一個定時器,固定時間執行接收)
Private Sub Form_Load()
Receive() = Timer1
End Sub (接收部分的部分並不是很瞭解,請大大可以給的方向參考嗎)
Private Sub Receive()
Dim FaxReceiveObj As FAXCOMEXLib.FaxRecipient
On Error GoTo Error_Handler
FaxServerObj.Connect ""
FaxReceiveObj.FaxNumber
FaxReceiveObj.Name
End Sub ~~~能幫助人的人最美