Salah a a a Al Jasem
asked on
Selecting fax body format is not working
I am sending a fax using VB6 on win7
if the .body = "myfile.txt" it works (text file)
any other format are not working
e.g.
if the .body = "myfile.doc" it is not working
if the .body = "myfile.html" it s not working
also is there a way to take body from a variable or a text box? because I am injecting names in each send
The followin is my code:-
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FAXCOMEXLib.FaxSender
On Error GoTo Error_Handler
objFaxServer.Connect ("")
objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\ Body.txt"
'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\ word2007.d oc"
'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\ word1997-2 003.doc"
'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\ 111.html"
objFaxDocument.DocumentNam e = "My First Fax"
objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_T YPE_ENUM.f ptHIGH
objFaxDocument.Recipients. Add ("9,22467713")
objFaxDocument.AttachFaxTo Receipt = True
objFaxDocument.CoverPageTy pe = FAXCOMEXLib.FAX_COVERPAGE_ TYPE_ENUM. fcptSERVER
objFaxDocument.CoverPage = "generic"
objFaxDocument.Note = "Here is the info you requested"
objFaxDocument.ReceiptAddr ess = "someone@example.com"
objFaxDocument.ScheduleTyp e = FAXCOMEXLib.FAX_SCHEDULE_T YPE_ENUM.f stSPECIFIC _TIME
objFaxDocument.ScheduleTim e = CDate("4:35:47 PM")
objFaxDocument.Subject = "Today's fax"
objFaxDocument.sender.Titl e = "Mr."
objFaxDocument.sender.Name = "Bob"
objFaxDocument.sender.City = "Cleveland Heights"
objFaxDocument.sender.Stat e = "Ohio"
objFaxDocument.sender.Comp any = "Microsoft"
objFaxDocument.sender.Coun try = "USA"
objFaxDocument.sender.Emai l = "someone@microsoft.com"
objFaxDocument.sender.FaxN umber = "12165555554"
objFaxDocument.sender.Home Phone = "12165555555"
objFaxDocument.sender.Offi ceLocation = "Downtown"
objFaxDocument.sender.Offi cePhone = "12165555553"
objFaxDocument.sender.Stre etAddress = "123 Main Street"
objFaxDocument.sender.Tsid = "Office fax machine"
objFaxDocument.sender.ZipC ode = "44118"
objFaxDocument.sender.Bill ingCode = "23A54"
objFaxDocument.sender.Depa rtment = "Accts Payable"
objFaxDocument.sender.Save DefaultSen der
JobID = objFaxDocument.ConnectedSu bmit(objFa xServer)
MsgBox ("The Job ID is :" & JobID(0))
objFaxServer.Disconnect
Exit Sub
Error_Handler:
MsgBox ("Error number: " & Hex(Err.Number) & ", " & Err.Description)
if the .body = "myfile.txt" it works (text file)
any other format are not working
e.g.
if the .body = "myfile.doc" it is not working
if the .body = "myfile.html" it s not working
also is there a way to take body from a variable or a text box? because I am injecting names in each send
The followin is my code:-
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FAXCOMEXLib.FaxSender
On Error GoTo Error_Handler
objFaxServer.Connect ("")
objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\
'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\
'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\
'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\
objFaxDocument.DocumentNam
objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_T
objFaxDocument.Recipients.
objFaxDocument.AttachFaxTo
objFaxDocument.CoverPageTy
objFaxDocument.CoverPage = "generic"
objFaxDocument.Note = "Here is the info you requested"
objFaxDocument.ReceiptAddr
objFaxDocument.ScheduleTyp
objFaxDocument.ScheduleTim
objFaxDocument.Subject = "Today's fax"
objFaxDocument.sender.Titl
objFaxDocument.sender.Name
objFaxDocument.sender.City
objFaxDocument.sender.Stat
objFaxDocument.sender.Comp
objFaxDocument.sender.Coun
objFaxDocument.sender.Emai
objFaxDocument.sender.FaxN
objFaxDocument.sender.Home
objFaxDocument.sender.Offi
objFaxDocument.sender.Offi
objFaxDocument.sender.Stre
objFaxDocument.sender.Tsid
objFaxDocument.sender.ZipC
objFaxDocument.sender.Bill
objFaxDocument.sender.Depa
objFaxDocument.sender.Save
JobID = objFaxDocument.ConnectedSu
MsgBox ("The Job ID is :" & JobID(0))
objFaxServer.Disconnect
Exit Sub
Error_Handler:
MsgBox ("Error number: " & Hex(Err.Number) & ", " & Err.Description)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You do need to check that the print handler is installed for each file type, sometimes gets removed.
The link is just to a page of examples.
The text file works so I think it is the print to handlers for other file types that is the issue.
I once has to install acrobat 6 ( when 8 was current ) as it had a print handler that did not display a settings box everytime
The link is just to a page of examples.
The text file works so I think it is the print to handlers for other file types that is the issue.
I once has to install acrobat 6 ( when 8 was current ) as it had a print handler that did not display a settings box everytime
ASKER
First
Yes I already read MSDN, and that is why I am trying to use (FAXCOMEXLib.dll).
If microsoft says (.doc) and (.xls) then there is no need that I check wether word or excell support PrintTo or no.
Or maybe I missunderstood you?
Secound
Regarding the link you have sent, it is confusing - it referes to FAXCOMEXLib.dll which is found within VB6 refarance list, and at the same time they say (InterFAX allows you to send faxes programmatically) as if they are trying to sell there product (InterFAX). I mean on one hand they talk about MS product - on the other - they have their product so reading the explanation they provide might not be for the dll I am using!! or what
regard