Faxing from VB.NET

  • Thread starter Thread starter Steli Andrei
  • Start date Start date
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
 
FAXCOMLib cannot be used to send fax via a remote server. It is meant to be
used only with a local server.

Thanks,
--
Chandrasekar R
Microsoft Printing, Imaging and Fax Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
 
Back
Top