I've searched the web and read about 100 pages on MSDN and I dont understand why the following code doesn't work. It error out everytime on the FaxDocument.Send line with a RunTime Error '-2147024890 (80070006) Method 'send' of object 'IFaxDoc' failed
Any Ideas would be great.
Public Function SendFax(FileName As Variant, FaxNumber As Variant, RecipName As Variant)
Dim objFaxServer As FaxServer
Dim FaxDocument As FaxDoc
Set objFaxServer = CreateObject("FaxServer.Faxserver")
Dim sSName As String
Dim iMsg As Integer
objFaxServer.Connect "//GLP-FAX"
objFaxServer.Connect "//GLP-FAX"
objFaxServer.ArchiveOutboundFaxes = 1
objFaxServer.Retries = 4
objFaxServer.RetryDelay = 4
Set FaxDocument = objFaxServer.CreateDocument(FileName)
FaxDocument.FaxNumber = FaxNumber
FaxDocument.DisplayName = "Tim"
FaxDocument.FileName = FileName
FaxDocument.Tsid = RecipName
Dim lSend As Long
FaxDocument.send
End Function
Sub TestFax()
Call SendFax("C:\test.doc", "1234567", "TEST")
End Sub
Any Ideas would be great.
Public Function SendFax(FileName As Variant, FaxNumber As Variant, RecipName As Variant)
Dim objFaxServer As FaxServer
Dim FaxDocument As FaxDoc
Set objFaxServer = CreateObject("FaxServer.Faxserver")
Dim sSName As String
Dim iMsg As Integer
objFaxServer.Connect "//GLP-FAX"
objFaxServer.Connect "//GLP-FAX"
objFaxServer.ArchiveOutboundFaxes = 1
objFaxServer.Retries = 4
objFaxServer.RetryDelay = 4
Set FaxDocument = objFaxServer.CreateDocument(FileName)
FaxDocument.FaxNumber = FaxNumber
FaxDocument.DisplayName = "Tim"
FaxDocument.FileName = FileName
FaxDocument.Tsid = RecipName
Dim lSend As Long
FaxDocument.send
End Function
Sub TestFax()
Call SendFax("C:\test.doc", "1234567", "TEST")
End Sub