I'll will try this and report back.
Regards
Mike
Ying-Shen Yu,
O.K. It fails in VB 6 as well with "Error 8007065E, Operation failed"
The code is below:
I have uninstalled fax services and reinstalled them again. This time though
it fails with a text file not a tiff. although my C# code works shown later
VB code:
Private Sub Form_Load()
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FaxSender
Dim JobID As Variant
'Error handling
On Error GoTo Error_Handler
'Connect to the fax server
objFaxServer.Connect ""
'Set the fax body
objFaxDocument.Body = "d:\temp\roy.txt" ' this is a normal text file.
'Name the document
objFaxDocument.DocumentName = "My First Fax"
'Set the fax priority
objFaxDocument.Priority = fptHIGH
'Add the recipient with the fax number 12225550100
objFaxDocument.Recipients.Add "01293 786747", "Mike Grace"
'Choose to attach the fax to the fax receipt
objFaxDocument.AttachFaxToReceipt = True
'Set the cover page type and the path to the cover page
objFaxDocument.CoverPageType = fcptSERVER
objFaxDocument.CoverPage = "generic"
'Provide the cover page note
objFaxDocument.Note = "Here is the info you requested"
'Provide the address for the fax receipt
objFaxDocument.ReceiptAddress = "mikeg@computastat-group.co.uk"
'Set the receipt type to email
objFaxDocument.ReceiptType = frtMAIL
'Specify that the fax is to be sent at a particular time
'objFaxDocument.ScheduleType = fstSPECIFIC_TIME
'CDate converts the time to the Date data type
'objFaxDocument.ScheduleTime = CDate("4:35:47 PM")
objFaxDocument.Subject = "Today's fax"
'Set the sender properties.
objFaxDocument.Sender.Title = "Mr."
objFaxDocument.Sender.Name = "Bob"
objFaxDocument.Sender.City = "Cleveland Heights"
objFaxDocument.Sender.State = "Ohio"
objFaxDocument.Sender.Company = "Microsoft"
objFaxDocument.Sender.Country = "USA"
objFaxDocument.Sender.Email = "someone@microsoft.com"
objFaxDocument.Sender.FaxNumber = "12165555554"
objFaxDocument.Sender.HomePhone = "12165555555"
objFaxDocument.Sender.OfficeLocation = "Downtown"
objFaxDocument.Sender.OfficePhone = "12165555553"
objFaxDocument.Sender.StreetAddress = "123 Main Street"
objFaxDocument.Sender.TSID = "Office fax machine"
objFaxDocument.Sender.ZipCode = "44118"
objFaxDocument.Sender.BillingCode = "23A54"
objFaxDocument.Sender.Department = "Accts Payable"
'Save sender information as default
objFaxDocument.Sender.SaveDefaultSender
'Submit the document to the connected fax server
'and get back the job ID.
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
MsgBox "The Job ID is :" & JobID(0)
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
End Sub
C#
private void MicrosoftFax()
{
FAXCOMEXLib.FaxServer fxsvr = new FAXCOMEXLib.FaxServer();
FAXCOMEXLib.FaxDocument fxdoc = new FAXCOMEXLib.FaxDocument();
try
{
fxsvr.Connect(""); // null for local fax server otherwise a computername
}
catch (Exception ex )
{
MessageBox.Show( ex.ToString());
}
fxdoc.Body = "d:\\temp\\roy.txt";
fxdoc.Recipients.Add(fax_number, "Mike Grace");
try
{
fxdoc.ConnectedSubmit(fxsvr);
}
catch ( Exception ex )
{
MessageBox.Show( ex.ToString());
}
fxsvr.Disconnect();
}
> I'll will try this and report back.
>
[quoted text clipped - 7 lines]
> > the Fax Service itself, will you have this problem if using VB6 or in C++?
> > You may find a sample code in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusin
> > g_5s6s.asp
> >
[quoted text clipped - 10 lines]
> > This mail should not be replied directly, please remove the word "online"
> > before sending mail.
"Ying-Shen Yu[MSFT]" - 15 Apr 2004 08:02 GMT
Hi Mike,
Then, this issue seems not related to interop,
I'd like to confirm if the fax deviced is installed properly, could you try
running this code snippt to see if the device is working properly?
<Configuring a Fax Device>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusin
g_58dh.asp
If the above code works ,you may try the "Sending fax" sample in MSDN to
see if works.
<Sending a Fax>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusin
g_58dh.asp
I also found google thread which have similiar problem, it suggets check
the association of your .tiff file. You may try it to see if it could
resolve your problem.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=uID82BP9
DHA.2404%40TK2MSFTNGP12.phx.gbl&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3
DUTF-8%26oe%3DUTF-8%26q%3DFaxDocument%2B8007065e
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
Mike Grace - 15 Apr 2004 15:19 GMT
Ying-Shen Yu,
Solved!
It was the tiff file association problem mentioned on google.
Thanks for your help.
Regards
Mike
> Hi Mike,
>
[quoted text clipped - 3 lines]
> running this code snippt to see if the device is working properly?
> <Configuring a Fax Device>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusin
> g_58dh.asp
> If the above code works ,you may try the "Sending fax" sample in MSDN to
> see if works.
> <Sending a Fax>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusin
> g_58dh.asp
>
> I also found google thread which have similiar problem, it suggets check
> the association of your .tiff file. You may try it to see if it could
> resolve your problem.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=uID82BP9
DHA.2404%40TK2MSFTNGP12.phx.gbl&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3
> DUTF-8%26oe%3DUTF-8%26q%3DFaxDocument%2B8007065e
>
[quoted text clipped - 9 lines]
> This mail should not be replied directly, please remove the word "online"
> before sending mail.
mani - 23 Apr 2004 06:01 GMT
Hi
I followed as in ur email
1. uninstall fax co
2. install again fax co
3. running same code which you provide in email
Still, i face same problem..
"-214702326
Operation failed
Even i tried to use same file path and text file to attach
I try to send fax by a USB D-link DU560u modem
Could you help me
Thanks a lot
Warm Regard
man
---