Send method of FaxDoc object

  • Thread starter Thread starter BURGSTAHLER Jean-Marc
  • Start date Start date
B

BURGSTAHLER Jean-Marc

Hello,

Using VB and the COM api for the fax services on Win 2000 Server SP4, I
simply try to send a fax.
When calling method Send of object faxdoc, I get the following message :
Error number : 8007000D, the method '~' of object '~' has failed.

Any suggestions ???

Thanks
 
BURGSTAHLER said:

This error code means "The data is invalid" which is pretty large and
unspecific...

What type of file are you trying to send? I encountered similar
problems while trying to send TIFs. I managed to get around the
problems just by creating a good file association for TIF files...
might work for you.
 
Hi,

I am trying to simply fax a text file.


Nicolas Caron said:
This error code means "The data is invalid" which is pretty large and
unspecific...

What type of file are you trying to send? I encountered similar
problems while trying to send TIFs. I managed to get around the
problems just by creating a good file association for TIF files...
might work for you.
 
BURGSTAHLER said:
Hi,

I am trying to simply fax a text file.

Ok... then I guess the problem should not be the file association
thing. Well maybe if you would paste your faxing code I could take a
look at it and I might spot something wrong... I am not a Fax API
expert, but I've worked with it so who knows... might be able to help.
 
Here is the code :

Private Sub CmdFax_Click()
Dim objFaxDocument As Object
Dim objFaxServer As Object
Dim objSender As Object
Dim JobID As Variant

'Error handling
On Error GoTo Error_Handler

LB.Clear

Set objFaxServer = CreateObject("FaxServer.FaxServer.1")
LB.AddItem ("OK <-- CreateObject Server")

'Connect to the fax server
objFaxServer.Connect "srvdev"
LB.AddItem ("OK <-- Server Connect")

Set objFaxDocument = objFaxServer.CreateDocument("c:\testfax.txt")
LB.AddItem ("OK <-- CreateDocument")

'Set the fax body
objFaxDocument.FileName = "c:\testfax.txt"
LB.AddItem ("OK <-- Filename")

'Name the document
objFaxDocument.DisplayName = "My First Fax"
objFaxDocument.FaxNumber = "123"
LB.AddItem ("OK <-- DisplayName and FaxNumber")

'Submit the document to the connected fax server
'and get back the job ID.

JobID = objFaxDocument.Send()
LB.AddItem ("OK <-- Send")

MsgBox "The Job ID is :" & JobID

objFaxServer.Disconnect

Set objFaxServer = Nothing
Set objFaxDocument = Nothing

Exit Sub

Error_Handler:
'Implement error handling at the end of your subroutine. This
implementation is for demonstration purposes
MsgBox "Error number: " & Hex(Err.Number) & ", " & Err.Description
Set objFaxServer = Nothing
Set objFaxDocument = Nothing

End Sub
 
BURGSTAHLER said:
Here is the code :

Private Sub CmdFax_Click()
Dim objFaxDocument As Object
Dim objFaxServer As Object
Dim objSender As Object
Dim JobID As Variant

'Error handling
On Error GoTo Error_Handler

LB.Clear

Set objFaxServer = CreateObject("FaxServer.FaxServer.1")
LB.AddItem ("OK <-- CreateObject Server")

'Connect to the fax server
objFaxServer.Connect "srvdev"
LB.AddItem ("OK <-- Server Connect")

Set objFaxDocument = objFaxServer.CreateDocument("c:\testfax.txt")
LB.AddItem ("OK <-- CreateDocument")

'Set the fax body
objFaxDocument.FileName = "c:\testfax.txt"
LB.AddItem ("OK <-- Filename")

'Name the document
objFaxDocument.DisplayName = "My First Fax"
objFaxDocument.FaxNumber = "123"
LB.AddItem ("OK <-- DisplayName and FaxNumber")

'Submit the document to the connected fax server
'and get back the job ID.

JobID = objFaxDocument.Send()
LB.AddItem ("OK <-- Send")

MsgBox "The Job ID is :" & JobID

objFaxServer.Disconnect

Set objFaxServer = Nothing
Set objFaxDocument = Nothing

Exit Sub

Error_Handler:
'Implement error handling at the end of your subroutine. This
implementation is for demonstration purposes
MsgBox "Error number: " & Hex(Err.Number) & ", " & Err.Description
Set objFaxServer = Nothing
Set objFaxDocument = Nothing

End Sub

Don't know if this might be your problem, but whenever I called the
"connect" method, I never passed any argument. You don't need to if
you're connecting to the fax service on the machine from which the code
runs...
 
I have tried wothout nothing as parameters for connect, but it doesn't work.
It gives an error because connect lacks a parameter
 
Hi, I have a problem with my two computers, the first one has installed the
Shared Fax Server, and the other one has installed the Shared Fax Client, so
I would like to use the connection between them using COM/API as described
below:

Dim FaxServer As Object
dim oFaxPorts as Object

Set FaxServer = CreateObject("FaxServer.FaxServer")

FaxServer.Connect ("SBS2003") 'SBS2003 is name of SBS 2003 with Shared
Fax Server
Set oFaxPorts = FaxServer.GetPorts



The problem occur when I use the 'GetPorts' method, that returns the
following error:

Run-time error '-2147467259 (80004005)':
Method 'GetPorts' of object 'IFaxServer' failed

I can use this Shared Fax Server from my workstation using Outlook2003 and
Word 2003

Thanks
 
I guess the problem is with the following line

It should instead be
objFaxDocument.FileName = "c:\\testfax.txt"

Two backslashes.

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