While sending fax throught the application in vb.net giving the below error on the line (Dim sFaxJobIds() As String = oFaxDoc.ConnectedSubmit(oFaxSvr)). Can someone please help us here.
Error : Operation failed
Code:
Dim oFaxSvrType As Type = Type.GetTypeFromProgID("FaxcomEx.FaxServer")
Dim oFaxSvr As Object = Activator.CreateInstance(oFaxSvrType)
Dim oFaxDocType As Type = Type.GetTypeFromProgID("FaxcomEx.FaxDocument")
Dim sFaxServerName As String
Try
'get name of this computer, we need this for the FaxServer object below
sFaxServerName = Environment.MachineName.Trim
oFaxSvr.Connect(sFaxServerName)
'run The routine for each Fax Data
Dim oFaxDoc As Object = Activator.CreateInstance(oFaxDocType)
With oFaxDoc
.Sender.FaxNumber = oFD.SenderOfficePhone
.Body = oFD.DocumentPath
If oFD.CoverPageName <> vbNullString Then
.Coverpage = oFD.CoverPageName
End If
If oFD.SenderName <> vbNullString Then
.Sender.Name = oFD.SenderName
End If
If oFD.SenderOfficePhone <> vbNullString Then
.Sender.OfficePhone = oFD.SenderOfficePhone
End If
If oFD.FaxNumber <> "" Then
If oFD.RecipientName <> "" Then
.Recipients.add(oFD.FaxNumber, oFD.RecipientName)
Else
.Recipients.add(oFD.FaxNumber)
End If
End If
End With
Dim sFaxJobIds() As String = oFaxDoc.ConnectedSubmit(oFaxSvr)
oFaxDoc = Nothing