无法使用VB.NET发送传真

  • 本文关键字:NET VB vb.net fax
  • 更新时间 :
  • 英文 :


我正在尝试编写一些从计算机发送传真的代码,我正在使用VB.NET桌面应用程序。。

这是我的代码

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Try
        Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
        Dim objFaxServer As New FAXCOMEXLib.FaxServer
        Dim objSender As FAXCOMEXLib.FaxSender = Nothing
        Dim JobID As Object
        objFaxServer.Connect("")
        objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH
        objFaxDocument.Body = "c:invoice.txt"
        objFaxDocument.DocumentName = "My First Fax"
        objFaxDocument.Recipients.Add(stringPhoneNumber, "the man with the money")
        objFaxDocument.AttachFaxToReceipt = True
        objFaxDocument.Note = "first text fax of the day in vb"
        objFaxDocument.Subject = "testing fax system in vb"
        JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
        MsgBox("The Job ID is :" & JobID(0))
    Catch ex As Exception
        MsgBox("Error number: " & Hex(Err.Number) & ", " & Err.Description)
    End Try

End Sub

现在,当我按下按钮时,代码运行没有问题,我得到了jobID,但我的收件人传真机没有收到传真。

我在电脑里有一个传真调制解调器,我把电脑和电话线连了起来。我把传真发送到与传真机相连的另一条线路。我的电脑运行Windows7终极版(64位)。

首先检查Windows服务传真是否正在运行。

那么,也许更多关于房产的数据会有所帮助。

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
    Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
    Dim objFaxServer As New FAXCOMEXLib.FaxServer
    Dim objSender As FAXCOMEXLib.FaxSender = Nothing
    Dim JobID As Object
    objFaxServer.Connect("")
    objFaxServer.Folders.OutgoingQueue.Retries = 0  
    objFaxServer.Folders.OutgoingQueue.Save() 
    objFaxServer.ListenToServerEvents(FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE)

    objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH
    objFaxDocument.Body = "c:invoice.txt"
    objFaxDocument.DocumentName = "My First Fax"
    objFaxDocument.Recipients.Add(stringPhoneNumber, "the man with the money")
    objFaxDocument.AttachFaxToReceipt = True
    objFaxDocument.Note = "first text fax of the day in vb"
    objFaxDocument.Subject = "testing fax system in vb"
    objFaxDocument.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstNOW 
    objFaxDocument.Sender.Name= "John Doe"
    objFaxDocument.Sender.FaxNumber= "John Doe number"
    objFaxDocument.Sender.Title= "My Fax"
    objFaxDocument.CoverPage = "Generic"
    objFaxDocument.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptNONE
    objFaxDocument.Note = "Text message"
    objFaxDocument.Sender.SaveDefaultsender()
    JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
    MsgBox("The Job ID is :" & JobID(0))
Catch ex As Exception
    MsgBox("Error number: " & Hex(Err.Number) & ", " & Err.Description)
End Try
End Sub

相关内容

  • 没有找到相关文章

最新更新