Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / April 2004

Tip: Looking for answers? Try searching our database.

Problem with Microsoft fax on XP with C# and tiff files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Grace - 13 Apr 2004 15:07 GMT
Hi,

I am trying to send a fax in C# using the XP fax com extended api.

If I specify the body of my message as a multi page .tiff file, it get the
following error:

"System.Runtime.InteropServices.COMWException(0x80070483): Operation
failed."

I cannot find any record of this error code and why it fails.

If I specify the body of my message as a .bmp file, it works fine.

Does the XP Fax API have trouble with multipage .tiff files?

Regards

Mike
"Ying-Shen Yu[MSFT]" - 14 Apr 2004 07:57 GMT
Hi Mike,
COM
I think we'd better first check if this error is caused by COM interop or
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

If you have any upates on this issue, please feel free to reply this thread.

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 - 14 Apr 2004 09:29 GMT
I'll will try this and report back.

Regards

Mike

> Hi Mike,
> COM
> I think we'd better first check if this error is caused by COM interop or
> 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 - 9 lines]
> This mail should not be replied directly, please remove the word "online"
> before sending mail.
Mike Grace - 14 Apr 2004 10:46 GMT
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

---
mani - 23 Apr 2004 06:47 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
mani

---
"Ying-Shen Yu[MSFT]" - 23 Apr 2004 08:16 GMT
Hi mani,

then you should try the suggestions in the google link I mentioned.

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

Open "MyComputer"  ->"Tools" ->"Folder Options"
In "Folder Options" ,switch to "File Types" dialog,
find  TIFF file extnetion, you may check if the Open with is set to Windows
Picture and Fax viewer, if not you may change it to this program and try
again.

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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.