Hi All,
In my application, I am currently employing FAXCOMEXLib to send out faxes. It works great, but one issue still remains. How can I send out multiple attachments in one Fax transmission using FAXCOMEXLib? As shown in the code snippet below, I only have the code which can only send out one attachment at a time. In return, Windows Fax Server takes my attachment and adds the local cover-page to it.
As I have read on the internet, I know this can be done, but no one has posted any sample codes of how actually it is implemented.
I hope someone out there can reply back with a sample code for this. - public int FaxDocument(String TheFile, string faxnumber)
-
{
-
int JobID = 0;
-
FAXCOMEXLib.FaxServer faxsrv = new FAXCOMEXLib.FaxServerClass();
-
-
try
-
{
-
faxsrv.Connect(Environment.MachineName);
-
var faxdoc = new FAXCOMEXLib.FaxDocumentClass();
-
-
//*** How can I add 2 or more attachments to my fax Body with the use of one coverpage?
-
faxdoc.Body = @"C:\Temp\test.doc";
-
//************************************************************************
-
-
faxdoc.Priority = FAX_PRIORITY_TYPE_ENUM.fptNORMAL;
-
-
faxdoc.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptLOCAL;
-
faxdoc.CoverPage = "TestCoverPage";
-
faxdoc.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstNOW;
-
faxdoc.DocumentName = "Fax Transmission";
-
faxdoc.Recipients.Add(faxnumber, "John Doe");
-
faxdoc.AttachFaxToReceipt = false;
-
faxdoc.Note = "Here is the info you requested";
-
faxdoc.Subject = "Today's fax";
-
-
faxdoc.ConnectedSubmit(faxsrv);
-
}
-
catch(Exception ex)
-
{
-
MessageBox.Show(ex.Message);
-
}
-
finally
-
{
-
faxsrv.Disconnect();
-
}
-
-
return JobID;
-
}
Thx
8 6883
Instead of useing faxdoc.Body use faxdoc.Bodies and for submit use faxserver.connectsubmited2
all the attachements store in a single array and assign the faxdoc.Bodies=array
Thanks for getting back to me. By any chance, do you have a code snippet that can help me checking on the status of the fax job to make sure if it was successfully faxed, or failed?
Please see the bellow sample rugh code. we can play with it. any issues plz mail me.
Dim WithEvents objFaxServer As New FAXCOMEXLib.FaxServer
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim JobID As Object
Dim STAttach1(1) As String
objFaxServer.Connect(Environment.MachineName)
objFaxServer.ListenToServerEvents(FAXCOMEXLib.FAX_ SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE)
strfilename = ""
STAttach1(0) = "D:\Robofax.pdf"
STAttach1(1) = "D:\Black-ICE.doc"
objFaxDocument.Bodies = STAttach1
objFaxDocument.DocumentName = "MedFax Testing"
Faxnumber = "26"
objFaxDocument.Recipients.Add(Faxnumber, "test")
objFaxDocument.AttachFaxToReceipt = True
objFaxDocument.Note = "TEST FAX (MEDFAX)"
objFaxDocument.Subject = "Testing FAX(MEDFAX)"
objFaxDocument.CoverPageType = FAX_COVERPAGE_TYPE_ENUM.fcptSERVER
objFaxDocument.CoverPage = "generic"
objFaxDocument.Note = "Here is the info you requested" '===Comments files
Dim strJobIds As Object
strJobIds = Nothing
JobID = objFaxDocument.ConnectedSubmit2(objFaxServer, strJobIds)
strJID = JobID(0)
strJobID = "The Job ID is :" & JobID(0)
MsgBox("The Job ID is :" & JobID(0))
'objFaxServer.Disconnect()
Once again thank you for this code resource you have posted. I will go ahead and use it right away. Do you also happen to know how can I use the returned JobID from your code and check for the status of my fax (sent, error, processing, etc) in the queue at some other time later? I hope you’ll be able to guide me on this one as well.
Thank you
SURE , I will try my best
I Forgot to tell you it will work only on windows vista.
sonnykei:
You can subscribe to OnOutgoingJobChanged event of the Fax Server Object.
Here's a snippet of my code (written in VB.NET)
I call my window app from a console app (automation):
Interesting issue and solution. FYI, there’s a page that documents common FAXCOMEXLib problems and solutions on the Interfax site: http://www.interfax.net/en/dev/faxcomexlib
If you have any more related issues, it includes information collected from major developer Web forums (including links to the discussions).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Scott Auge |
last post by:
I am looking for comments on something that lets me abstract database
updates in an object.
Lemme explain what I am thinking:
Lets say I have an object Person with...
SetFirstName()...
|
by: Neil Zanella |
last post by:
Hello,
I would be very interested in knowing how the following C++ multi-instance
singleton (AKA Borg) design pattern based code snippet can be neatly coded
in Python. While there may be...
|
by: Lichunlin |
last post by:
Dear all,
Sorry for cross posting.
I have one page, create an object and save it in session scope, and then redirect to another page.In the new page, the object existed in session object, but...
|
by: Sean McKaharay |
last post by:
I am using the code below and I am getting this error:
"Insufficient state to deserialize the object. More information is needed."
Has anyone seen this? It is working with other dll's but not on a...
|
by: Rick |
last post by:
Hi,
Does deleting an object more than one times incur undefined behavior? I
think it doesn't but just making sure... thanks
Rick
|
by: Roger Smythe |
last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts
such that these component parts represent higher levels of conceptual abstraction, and are...
|
by: Joe Fallon |
last post by:
I would like to know the syntax to check that an Object is a String.
If it was a number test I might use IsNumeric.
But there is no function: IsString (is there?)
--
Joe Fallon
|
by: Michael Moreno |
last post by:
Hello,
In a class I have this code:
public object Obj;
If Obj is a COM object I would like to call in the Dispose() method the
following code:
...
|
by: FAQ server |
last post by:
-----------------------------------------------------------------------
FAQ Topic - How do I access a property of an object using a string?...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |