I am trying to get winfax ole to work. I am unfamiliar with the syntax. I have put in the following for the function winfaxole:
WinfaxOLE(topparent:Fax_no,report,:fax_test," "," ")
where Fax_no is a field on a test form
report named Fax_test
At this point I don't care about filter or order.
When I press the button for this code I get fax_test not found. I have played with the syntax on fax_test but can't get it to work. I am stumped on this.
Any help on this would be appreciated.
This is Selwyn's post on the xbasic for the function.
'Here is a sample script that is actually part of A5 that shows how we used OLE Automation to control Winfax:
'In the function, Obj_type is "report", "Label", "letter" etc. and Obj_name is the name of the object. E.g. the "customer_list" report.
'filter_str is the filter for the report, and order is the order for the report.
function WinfaxOLE as L(fax_num as C,obj_type="",obj_name="",filter_str="",order="")
dim eval_str as c 'strings for the print driver setup
dim saved_output_file as c
dim saved_driver as c
dim areacode as c
dim Winfaxsend as p
Winfaxsend = ole.create("Winfax.SDKSend8.0")
Winfaxsend.SetUseCover(1)
'set the number of the recipient
Winfaxsend.addrecipient()
'see if there is an area code
if len(fax_num) > 7 then
areacode = left(fax_num,3)
faxnum = right(fax_num,7)
Winfaxsend.SetAreaCode(areacode)
end if
Winfaxsend.SetNumber(fax_num)
Winfaxsend.removerecipient() 'these two lines are necessary because of Winfax's interface
Winfaxsend.addrecipient()
'attach the file
Winfaxsend.SetPrintFromApp(1) 'tells Winfax to expect something from the printer driver
'print to the Winfax driver
saved_output_file = ":" + obj_type + ".output_file_override(\"\\temp.rtf\")"
saved_driver = ":" + obj_type + ".printer_override(\"Winfax\")"
print = obj_type + ".print(\"" + obj_name + "\",\"" + filter_str + "\",\"" + order +"\")"
eval(saved_driver)
eval(print)
restore_output_file = ":" + obj_type + ".output_file_override(\"\")"
restore_driver = ":" + obj_type + ".printer_override(\"\")"
eval(restore_output_file)
eval(restore_driver)
'send
Winfaxsend.send(0)
'for Winfax cleanup
Winfaxsend.done(1)
'delete the Winfax object
delete Winfaxsend
end functionFUNCTION Winfax AS L ( )
END FUNCTION
WinfaxOLE(topparent:Fax_no,report,:fax_test," "," ")
where Fax_no is a field on a test form
report named Fax_test
At this point I don't care about filter or order.
When I press the button for this code I get fax_test not found. I have played with the syntax on fax_test but can't get it to work. I am stumped on this.
Any help on this would be appreciated.
This is Selwyn's post on the xbasic for the function.
'Here is a sample script that is actually part of A5 that shows how we used OLE Automation to control Winfax:
'In the function, Obj_type is "report", "Label", "letter" etc. and Obj_name is the name of the object. E.g. the "customer_list" report.
'filter_str is the filter for the report, and order is the order for the report.
function WinfaxOLE as L(fax_num as C,obj_type="",obj_name="",filter_str="",order="")
dim eval_str as c 'strings for the print driver setup
dim saved_output_file as c
dim saved_driver as c
dim areacode as c
dim Winfaxsend as p
Winfaxsend = ole.create("Winfax.SDKSend8.0")
Winfaxsend.SetUseCover(1)
'set the number of the recipient
Winfaxsend.addrecipient()
'see if there is an area code
if len(fax_num) > 7 then
areacode = left(fax_num,3)
faxnum = right(fax_num,7)
Winfaxsend.SetAreaCode(areacode)
end if
Winfaxsend.SetNumber(fax_num)
Winfaxsend.removerecipient() 'these two lines are necessary because of Winfax's interface
Winfaxsend.addrecipient()
'attach the file
Winfaxsend.SetPrintFromApp(1) 'tells Winfax to expect something from the printer driver
'print to the Winfax driver
saved_output_file = ":" + obj_type + ".output_file_override(\"\\temp.rtf\")"
saved_driver = ":" + obj_type + ".printer_override(\"Winfax\")"
print = obj_type + ".print(\"" + obj_name + "\",\"" + filter_str + "\",\"" + order +"\")"
eval(saved_driver)
eval(print)
restore_output_file = ":" + obj_type + ".output_file_override(\"\")"
restore_driver = ":" + obj_type + ".printer_override(\"\")"
eval(restore_output_file)
eval(restore_driver)
'send
Winfaxsend.send(0)
'for Winfax cleanup
Winfaxsend.done(1)
'delete the Winfax object
delete Winfaxsend
end functionFUNCTION Winfax AS L ( )
END FUNCTION
Comment