S
Steli Andrei
I try to fax from VB.NET. If I am using the fax that's on
my laptop it works. When in the network and I use the fax
that's on server (W2003) I get this error:
"The handle is invalid" and it occurs at:
FAXCOMLib.IFaxDoc.Send(). What do I do wrong ?
This is my code:
Imports System.IO
Imports FAXCOMLib
Public Sub SendFax(ByVal FaxServerName As String, ByVal
FaxNumber As String, ByVal DisplayedName As String, ByVal
SenderName As String, ByVal FileToBeFaxed As String)
Dim fs As Object
Dim fd As FaxDoc
fs = CreateObject("FaxServer.FaxServer")
try
fs.Connect(FaxServerName)
fd = fs.CreateDocument("MyFax")
fd.FileName = FileToBeFaxed
fd.FaxNumber = FaxNumber
fd.SenderName = SenderName
fd.DisplayName = DisplayedName
fd.DiscountSend = 0
fd.ServerCoverpage = 0
fd.Send()
Catch ex As Exception
Throw New Exception(ex.Message)
Finally
fd = Nothing
fs = Nothing
End Try
End Sub
my laptop it works. When in the network and I use the fax
that's on server (W2003) I get this error:
"The handle is invalid" and it occurs at:
FAXCOMLib.IFaxDoc.Send(). What do I do wrong ?
This is my code:
Imports System.IO
Imports FAXCOMLib
Public Sub SendFax(ByVal FaxServerName As String, ByVal
FaxNumber As String, ByVal DisplayedName As String, ByVal
SenderName As String, ByVal FileToBeFaxed As String)
Dim fs As Object
Dim fd As FaxDoc
fs = CreateObject("FaxServer.FaxServer")
try
fs.Connect(FaxServerName)
fd = fs.CreateDocument("MyFax")
fd.FileName = FileToBeFaxed
fd.FaxNumber = FaxNumber
fd.SenderName = SenderName
fd.DisplayName = DisplayedName
fd.DiscountSend = 0
fd.ServerCoverpage = 0
fd.Send()
Catch ex As Exception
Throw New Exception(ex.Message)
Finally
fd = Nothing
fs = Nothing
End Try
End Sub