How to send fax using VB.net
-
Hi All,
I caught the error while running the following code in VB.net 1.1 on my XP.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FaxSender
Dim JobID As Object
objFaxServer.Connect("LAB1-STU15")
objFaxDocument.Body = "c:\Test.txt"
objFaxDocument.DocumentName = "My First Fax"
objFaxDocument.Recipients.Add("94114619774", "Bud")
objFaxDocument.AttachFaxToReceipt = True
objFaxDocument.Note = "Here is the info you requested"
objFaxDocument.Subject = "Today's fax"
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
MsgBox("The Job ID is :" & JobID(0))
Catch ex As Exception
MsgBox("Error number: " & Hex(Err.Number) & ", " & Err.Description)
End Try
End Sub
It gives me foloowing error.
"Error number: 800710D8, Operation failed."
I double check all the variables. But those are correct. File is there.
The exception is System.Runtime.InteropServices.Exception.
I don't know what to do.
I prefer if somebody can help me to solve the problem.
Pls reply me ASAP. Since I have to show this project 19th of September.
Cheers,
Gayan -
Install a fax printer to send a fax. You need to install a FAX printer before executing this operation on your computer to avoid this error.
GMIke
"I would love to change the world, but they won't give me the source code." -
Hi GMike,
Sorry for late reply.
Yesterday night I have tried it and it works fine.
Thanks a lot.
I also read your funny thread.
Cheers,
Gayan -
Hi GMike and All,
As I told you my fax works fine.
But since I want to enhance the application I used this code for the asp.net web project.
I checked it with .txt file and it works fiine.
But when I try to send .doc file it doen't get faxed.
I put a breakpoint and checked it. Code didn't execute after ConnectedSubmit method.
It doesn't gave me any error as well. But it tooks lot time but nothing happens.
I again try with .txt file which is 1kb size. It works fine.
But for the .doc file which is 20kb file it took lot time. But nothing happens.
FOr VB.net application it works for both .txt and .doc file.
So what should I do to get rid of this problem.
Time is ticking. I need help very ASAP.
Best Regards,
Gayan -
Try to set the priority of FaxDocument to Highest, may be this will work although not tested.
Code:
objFaxDocument.Priority = fptHIGH
objFaxServer.Connect("LAB1-STU15")
objFaxDocument.Body = "c:\abc.doc"
GMike
"I would love to change the world, but they won't give me the source code." -
Hi ,
I have the same problem. When I try to send a FAX, it works fine on my local WinXP machime, but when I try on my Win2003 server it doesn't work. Windows fax service is installed on both. There are no differences between the configs.
I can connect to the sever, list the jobs and much more, but when I try to send a Fax using
"ConnectedSubmit(faxServer)"
I get an Exception with the error code "800710D8".
It's weird, because I can acces all the jobs but can't send a Fax.
Any idea?
Thanks!
Here is my code:
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FAXCOMEXLib.FaxSender
Dim JobID As Object
Dim devices As FAXCOMEXLib.FaxDevices Dim device As FAXCOMEXLib.FaxDevice 'Error handling On Error GoTo Error_Handler 'Connect to the fax server'This doesn't work... :-(
objFaxServer.Connect("MyFaxServer")
'This works fine!
objFaxServer.Connect("")
'Set the fax body
objFaxDocument.Body = "C:\test.txt"
'Name the documentobjFaxDocument.DocumentName = "My First Fax"
'Set the fax priorityobjFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH
'Add the recipient with the fax number 12225550100objFaxDocument.Recipients.Add("4893310", "Bud")
'Choose to attach the fax to the fax receiptobjFaxDocument.AttachFaxToReceipt =
True 'Set the cover page type and the path to the cover pageobjFaxDocument.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptNONE
'objFaxDocument.CoverPageType.FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptNONE()objFaxDocument.CoverPage = "generic"
'Provide the cover page noteobjFaxDocument.Note = "Here is the info you requested"
'Provide the address for the fax receiptobjFaxDocument.ReceiptAddress = ""
'Set the receipt type to emailobjFaxDocument.ReceiptType = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMSGBOX
'Specify that the fax is to be sent at a particular timeobjFaxDocument.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstNOW
' FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.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 = "[email protected]"
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"
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 SubError_Handler:
'Implement error handling at the end of your subroutine. This implementation is for demonstration purposesMsgBox("Error number: " & Hex(Err.Number) & ", " & Err.Description)
-
I receive error: 800710D8. After searching the error on Google, I found out that the error means that the fax printer isn't installed on the client machine.
The network fax that is installed on my PC (Win XP Pro SP2) is the fax modem on the server. The fax icon in "Printers and Faxes" is a MS Shared Fax Driver and clicking on opens up Fax Console. So I should be able to send a fax through the vb code and that fax should appear in the Fax Console.If I have a MS Fax Shared Driver installed then why the error? Any suggestions on how to resolve the error?
Thanks.
-
can you tell me what refrences you added to your project to make these command lines work
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FaxSender
Dim JobID As Object
i need to send a .doc via a fax with a fax printer -
Main reference you need to install is "MS Fax Service Extended COM Library". Any idea on the error that I mentioned above?
-
only thing i can think of is that they dont have access to your computer or the printer that you are using isnt really set up as a fax printer
-
I am having problem in a somewhat different scenario, which is mentioned below:
-------------------------------------------------------------------------------------
"Adobe Reader --
Faxing a pdf document
My Dot net(C#) based application sends fax messages. I am using FAXCOMLIB.DLL version=1.0.0.0 (Microsoft's dll used for faxing) and runtime version=v1.1.4322 for sending the fax message. When the application attaches a PDF Document and sends the Fax message, an Adobe Acrobat reader instance gets opened in a minimized state.This happens whenever the application sends a fax message with PDF Document attached, a new instance of Acrobat reader gets opened everytime (in a minimized state) and neither of them closes on completion of sending the Fax message. We have to close all those opened instances of Acrobat Reader manually. This however does not happen while faxing Microsoft word documents.I am using the following code:
--------------------------------
public
bool SendFax(string pstrSubject, string pstrMsgFileName,string pstrPDFFileName, string pstrUserName, string pstrFaxNumber,string pstrFaxServerName){
bool bIsService=FaxServiceCheck(); if(pstrFaxServerName=="(local)"){
pstrFaxServerName=Environment.MachineName;
}
FAXCOMLib.FaxServer faxServer =
new FAXCOMLib.FaxServerClass(); try{
faxServer.Connect(pstrFaxServerName);
}
catch{
MessageBox.Show("Unable to connect the Fax Server, Please make sure the Fax Service is Running.");
}
FAXCOMLib.FaxDoc faxDoc1 = (FAXCOMLib.FaxDoc)faxServer.CreateDocument(pstrPDFFileName);
FAXCOMLib.FaxDoc faxDoc2=(FAXCOMLib.FaxDoc) faxServer.CreateDocument(pstrMsgFileName);
faxDoc1.RecipientName = pstrUserName;
faxDoc1.FaxNumber = pstrFaxNumber;
faxDoc1.DisplayName = "Caravan Messaging System";
faxDoc2.RecipientName = pstrUserName;
faxDoc2.FaxNumber = pstrFaxNumber;
faxDoc2.DisplayName = "Caravan Messaging System";
try{
int Response = faxDoc1.Send();faxServer.Disconnect();
}
catch{
}
try{
int Response = faxDoc2.Send(); return true;}
catch{
return false; }}
If someone can suggest a workaround for this, please advice. " -
Hey did you get the this problem resolved? I am having the same issue. I can fax the ms word document by printing it to the remote fax server but it does not work from the Visual Basic Code. It fails on ConnectedSubmit(objFaxServer) returning "800710D8"
Can you please share the fix?
Thank you...
-
Hi dear,
can u tell me that where i found the dll for FAXCOMEXLib ?
and that file is work in windows 2000 or not?
Please tell immediatly i need it.
Thanks
-
hi,
you can find the FAXCOMEX.DLL in windows 2003/SBS server.
-
Hi!
I'm working with the FAXCOMlib library to implement a fax aplication for sending and receiving faxes and I need to get the image that the Windows Fax Machine generates into a temporal folder.
What can I do to reference the image with the FaxTiff object?
Thank you very much for any information.
-
Any information about the faxcomlib faxtiff library?
Thanks.
-
Hi All,
I have read through the previous messages in the this thread relating to the use of VB.Net to send fax, however I would like to know if it is possible to send fax with VB6 and how can I do this? preferably without major cost implications. Can some please give me an example of the code that may be required.
Thanks,
Chirag.
-
Hi, Thanks for your code. I was searching code and i find it in Developerfusion site. Its working fine. I need some more help. Can you tell me how to send bulk fax. I have data like Fax no. and recipient name in data grid now i want to send the fax using for loop for all the data. Thanks in advance Enjoy Programming Medha.net
-
i am currently having my internship training at an IT company.my supervisor had ask me to create a solution for a fax integration. i was told to code a coding that can verify a fax number in a .txt file(it can be one fax number or many), then it will trigger another program (he asked me to download an open source software) to send faxes to the recipients (the fax number verified before). thruthfully,i have no idea how to do this. anyone can help me, at least what software can be best used and how the flow of this assignment should be. as for verifying the fax number, i am using simple java code with Luhn algorithm, but i ABSOLUTELY have no idea hot to integrate it with other (existing or newly created by me) software to send faxes..any help will be much appreciated..thanks.
!--removed tag--> -
Hi all,
Following this interesting discussion, there's a page that might be of help, which documents common FAXCOMEXLib problems and solutions (InterFax site), and collects similar issues and links to discussions on major developer forums.
!--removed tag--> -
Hi,
Thanks a lot, It's nice post my work.
Daniel !--removed tag-->
Post a reply
ASP.NET forum discussion
-
How to get Hotmail Contacts
by salihagenter (5 replies)
-
How to send fax using VB.net
by Jeffry Clyde (35 replies)
-
Difference between class and interface
by aladanh.go (47 replies)
-
How to Add Text in Footer of Gridview?
by arthurmarsh (5 replies)
-
Using FedEx Web Service to Calculcate Shipping Cost
by ravialen3782 (8 replies)
ASP.NET tutorials
- The Evolution of a Azure Web Application
- Protecting your ASP.NET Web API using OAuth2 and the Windows Azure Access Control Service
- Using HTML5 History in an ASP.NET MVC Site
- An Introduction to testing with the Model-View-Presenter pattern for Web Forms Development
- Improving Web Site Performance and Scalability while saving money
Quick links
Recent activity
- arif ahmad replied to How to receive data in web ...
- William Thompson replied to What is the name of the Win...
- Sameera Piyadigamage replied to Point of Sale Developers: H...
- Scott Carline replied to 4 x C# Developers for large...
- Rajendra Dhakal replied to Restore SQL Server text dat...
- cloud rainda replied to How to convert between TS f...
Enter your message below
Sign in or Join us (it's free).