Sending fax using VB
Posted on 2007-07-29
Sending fax using VB6
I have been looking for methods to send bulk fax from my application that I need to distribute. The solutions seem to be either of the two
1. But commercial ocx for sending fax
2. Use Mapi/outlook with microsoft fax printer or any other printer or use fax server object
The first one has some negative points.
1. Commercially available active Xs like Faxman does not Fax word documents. Most of the users want to send multipage word-document as faxes. They don't want to scan it into tiff and then send again.
2. There have been complaints that, the readability of tiff files faxed using these controls is lower compared to readability of TIFF documents faxed by selecting print option and then printing to fax printer, in windows picture viewer
3. Some SDKs require their own fax service to be bought and installed. Other than my application, my user also has to buy this fax service.
Second method is using MAPI/fax server object/outlook scripting
Code downloaded from sites like freevbcode and planet-source-code and even EE does not work. Run time error pops up, saying activex can't create object or send method failed etc. I have tried at least 15
sample codes. But none works correctly.
See a code below
MapiSession1 - a mapi session activex
MAPIMessages1 - a mapi message activex
both activeX come with VISUAL STUDIO
MAPISession1.DownLoadMail = False
MAPISession1.LogonUI = True
MAPISession1.NewSession = True
MAPISession1.Action = mapSignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.MsgIndex = -1
MAPIMessages1.RecipType = 1
MAPIMessages1.RecipDisplayName = "[fax:"Fax Number"]"
MAPIMessages1.AddressResolveUI = False
MAPIMessages1.AttachmentPathName = File_To_Send
In the above code , MAPIMessages1.RecipDisplayName = "[fax:"Fax Number"]" works if faxrecipient name is directly given. Otherwise, it says 'unknown recipient'
MAPIMessages1.RecipDisplayName ="My receipient" works, but it goes as mail
MAPIMessages1.RecipDisplayName = "[fax:'800343434']" doesnt work. Says 'unknown recipient'.
SImilarly, not a single code seems to be working correctly even though I am able to send fax using fax printer . outlook directly.
1. Is there any surefire meThod of sending fax from any machine using VB under all conditions? Does it work if MS Office is not installed?
2. Does microsoft Fax come by default with all versions of windows? If not what method can be used in VB that will work with any version of windows? ie: some thing that works with win 2000, 2003, xp etc. ?
3. Does outlook express come free with all versions of windows? Can this be used along with VB6 to have a 100 percent sure shot fax application?
4. Is there any 3rd party control that can be used to fax any document easily with good readability and automatability for bulk faxing?