Faxing from VB.NET

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
 
C

Chandrasekar [MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top