Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual FoxPro and WinFax

Status
Not open for further replies.

generlam

Programmer
Jun 13, 2001
75
US
Can anyone fill in the specifics for Winfax in the code from a previous thread?

oFaxObject=CreateObject('MyFaxSoftware.MyFaxObject')
SET PRINTER TO NAME 'MyFaxPrinter Name'
REPORT FORM MyReport TO PRINTER
REPORT FORM MyReport2 TO PRINTER
oFaxObject.FaxNumber='5555555'
oFaxObject.Send

Do I need to do anything else but add this code to my program in order to send faxes?
I am replacing DOS FoxPro 2.6 code run from a .bat file that sent faxes via DataFax software to our vendors overnight. We have over 700 vendors and store the fax numbers in our vendor table. I can re-use most of the code to create the documents, and hopefully just change the section that would send each doc to the queue.
I'm in urgent need of this info, since the Novel server housing the DataFax is migrating to NT within a few weeks.

If I start the WinFax controller and set the printer to 'WinFax" I can do the 'report form abcd to printer' and it gets sent to Winfax, but I still have to manually enter the phone number. I need to be able to send the fax programmatically using the phone numbers retrieved by the code.
 
oFaxObject=CreateObject('MyFaxSoftware.MyFaxObject')
SET PRINTER TO NAME 'MyFaxPrinter Name'
Use Vendor
Go Top
Do While !Eof()
mFaxno=Allt(Fax_Number)
REPORT FORM MyReport TO PRINTER
REPORT FORM MyReport2 TO PRINTER
oFaxObject.FaxNumber=mFaxno
oFaxObject.Send
Skip
Enddo
I hope this will be help or correct with your question.
Chuong,
 
I have tried the above code and come up with an error message whenever I get to oFaxObject.FaxNumber=mFaxno which says "OLE error code 0x80020006: Unknown name" I get the same error number even if I hardcode the fax number in.
 
IIRC, WinFax doesnt expose the properties directly to the client. They provide methods to query/set the properties like so:

oFaxObject.SetFaxNumber(mFaxNo)
oFaxObject.SetSubject("Testing")
oFaxObject.Send

? oFaxObject.GetFaxNumber()
? oFaxObject.GetSubject()

Similar to the way VFPers expose protected properties.
FWIW, it's been about a year since I've worked with WinFax, so this is a vague recollection. You may wanna download their SDK including the documentation and samples in VB & VC++. Try . Jon Hawkins
 
Thanks. I'll check it out, but at this point, I'm trying to convince the users to go with e-mail. It's a whole lot less complicated.
 
I ran the code and still got the same error message when it hit oFaxObject.SetFaxNumber(mFaxNo). I didn't get an error using oFaxObject.SetNumber(mFaxNo)but have a problem looping through my code to fax multiple vendors.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top