Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending FAX from Visual Studio 2005

Status
Not open for further replies.

Clanger67

Programmer
Mar 28, 2002
28
GB
I have a web page with a button on and when I click I just want to send a fax.

The code I have, which I found by browsing on the net is pasted below.

It works fine until it gets to the .send part and then I get the following error:

[bold]
The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
[/bold]

I have searched the web and I cannot find a way to resolve this.

CODE
[blue]
Sub SendFax()
Dim lngSend As Long
Dim strComputer As String
Dim oFaxServer As FAXCOMLib.FaxServer
Dim oFaxDoc As FAXCOMLib.FaxDoc

strComputer = "\\compname\fax"
oFaxServer = New FAXCOMLib.FaxServer
oFaxServer.Connect(strComputer)
oFaxServer.ServerCoverpage = 0
oFaxDoc = oFaxServer.CreateDocument("c:\testfax.pdf")


With oFaxDoc

.FaxNumber = "901234567890"
.FileName = "c:\testfax.pdf"
.RecipientName = "Test"
.SenderName = "DC"
.DisplayName = "Fax Test"
lngSend = .Send - [red]Code errors here[/red]

End With

oFaxDoc = Nothing
oFaxServer.Disconnect()
oFaxServer = Nothing

End Sub
[/blue]
Any help would be much appreciated

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top