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
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