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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Winfax from VFP 3

Status
Not open for further replies.

jdhilljr

Programmer
Sep 1, 2003
296
US
I am using VFP to automate faxing via Winfax. The problem I am having with this code is that 3 pages are being sent with each fax and all three are identical even though there should only be 2 different documents. There may be a default cover sheet explaining the third document but why would all three be identical.

I am using VFP 6.0.
The table I am using only has 2 records currently.

sele 11
use fax shared
go top
do while !empty(company) and !eof()
xcompany = company
xname = name
xfaxno = faxno
xsubject = subject
xfilename = filename
xacode = acode
oWinFax = CreateObject("WinFax.SDKSend")
oWinFax.SetSubject(xsubject)
oWinFax.SetNumber(xfaxno)
oWinFax.SetAreaCode(xacode)
oWinFax.SetCompany(xcompany)
oWinFax.AddRecipient() && Required
oWinFax.AddAttachmentFile(xfilename)
oWinFax.SetPrintFromApp(1)
oWinFax.Send(1)
SET PRINTER TO NAME winfax
REPORT FORM testfax TO PRINT NOCONSOLE
RELEASE oWinFax
skip
enddo
use


Thanks,
Jim
 
I got no response. You forced me to find a fantastic utility program that helped me resolve the issue. It is faxDDE. It allows you to verify the information sent via DDE and correct the output. This below now works perfectly.



SELE 11
USE fax SHARED
GO TOP
DO WHILE !EMPTY(company) AND !EOF()
faxnumber = ALLTRIM(faxno)
sendtime = time()
senddate = dtoc(date())
faxname = ALLTRIM(fax.NAME)
xcompany = ALLTRIM(company)
xsubject = ALLTRIM(subject)
xfile = alltrim(filename)
keyword = "fax, test"
billingcode = "20321"
mode = "Fax"
recip = "recipient(" + CHR(34) + faxnumber + CHR(34) + "," + CHR(34) + sendtime + CHR(34) + "," + CHR(34) + senddate + CHR(34) + ","
recip = recip + CHR(34) + faxname + CHR(34) + "," + CHR(34) + xcompany + CHR(34) + "," + CHR(34) + xsubject + CHR(34) + ","
recip = recip + CHR(34) + keyword + CHR(34) + "," + CHR(34) + billingcode + CHR(34) + "," + CHR(34) + mode + CHR(34) + ")"
xattach = "attach(" + chr(34) + xfile + chr(34) + ")"
faxchan = DDEINITIATE("FAXMNG32","CONTROL")
retvar=DDEEXECUTE(faxchan,"GoIdle")
faxchan = DDEINITIATE("FAXMNG32","TRANSMIT")
retvar=DDEPOKE(faxchan,"sendfax", xattach)
retvar=DDEPOKE(faxchan,"sendfax", recip)
retvar=DDEPOKE(faxchan,"Sendfax",'resolution("HIGH")')
retvar=DDEEXECUTE(faxchan,"GoActive")
retvar=DDEPOKE(faxchan,"sendfax",'showsendscreen("0")')
retvar=DDEPOKE(faxchan,"sendfax","SendFaxUI")
retvar=DDETERMINATE(faxchan)
SKIP
ENDDO
USE


Jim
 
Hi Jim

Just tagging on the end of this with much interest. Are you saying here, that you don't need WinFax to run your code and just use the download as described?

Your reply would be very much appreciated

Lee.....

VisFox Version 6 User / Windows ME
 
Once you download the zip file. Run the executable called FaxDDE. With it open I ran my program and didn't even have winfax on my computer and was able to verify all the DDE info transmitted to be sure it followed acceptable parameters.

Jim
 
Thanks for the prompt reply Jim. I'll give it a try over the next few days and post back. Even though it's your thread, you deserve a star for your time and effort!

Lee

VisFox Version 6 User / Windows ME
 
Hi Jim

Can you do me favour and post the structure of your fax table or email it to me please with a couple of example records?

Go here for the support email address:
Many thanks in anticipation
Lee

VisFox Version 6 User / Windows ME
 
This is an export of the table "fax" exported in delimited text.

"Company Name","Jim Hill","337-8400","test","c:\test.txt","F"
"Company Name","Jim Hill","334-9319","Testing","c:\testing.txt","F"

All are set as character. The "F" at end is placed confirming it is faxed. Make sure that you alter the number for dialing properties and set winfax for no properties. Mine is set to dial 9 only for an outside line. There are no spaces or special characters between the area code and number.

This is a sample with dialing propety changes and allowing to grab any file.

xfile = getfile()
SELE 11
USE actgroups index xactgroups SHARED
set filter to groupid = 23
GO TOP
DO WHILE !EMPTY(groupid) AND !EOF()
xuid = unique_id
sele 12
use contacts index xcontacts shared
set order to 1
seek xuid
if len(alltrim(fax)) = 14
if ALLTRIM(upper(city)) == "BRANSON" OR ALLTRIM(UPPER(CITY)) = "HOLLISTER"
faxnumber = subst(ALLTRIM(fax),7,8)
else
faxnumber = "1" + subst(alltrim(fax),2,3) + subst(alltrim(fax),7,8)
endif
sendtime = time()
senddate = dtoc(date())
faxname = ALLTRIM(contacts.NAME)
xcompany = ALLTRIM(company)
xsubject = "Test Fax"
keyword = "fax, test"
billingcode = "20321"
mode = "Fax"
recip = "recipient(" + CHR(34) + faxnumber + CHR(34) + "," + CHR(34) + sendtime + CHR(34) + "," + CHR(34) + senddate + CHR(34) + ","
recip = recip + CHR(34) + faxname + CHR(34) + "," + CHR(34) + xcompany + CHR(34) + "," + CHR(34) + xsubject + CHR(34) + ","
recip = recip + CHR(34) + keyword + CHR(34) + "," + CHR(34) + billingcode + CHR(34) + "," + CHR(34) + mode + CHR(34) + ")"
xattach = "attach(" + chr(34) + xfile + chr(34) + ")"
faxchan = DDEINITIATE("FAXMNG32","CONTROL")
retvar=DDEEXECUTE(faxchan,"GoIdle")
faxchan = DDEINITIATE("FAXMNG32","TRANSMIT")
retvar=DDEPOKE(faxchan,"sendfax", xattach)
retvar=DDEPOKE(faxchan,"sendfax", recip)
retvar=DDEPOKE(faxchan,"Sendfax",'resolution("HIGH")')
retvar=DDEEXECUTE(faxchan,"GoActive")
retvar=DDEPOKE(faxchan,"sendfax",'showsendscreen("0")')
retvar=DDEPOKE(faxchan,"sendfax","SendFaxUI")
retvar=DDETERMINATE(faxchan)
else
endif
sele 11
skip
ENDDO
USE

Hope this helps,

Jim
 
Thanks Jim, I'm grateful. I'll post back sometime this week and let you know (and others reading this) the outcome

Kindest regards

Lee....

VisFox Version 6 User / Windows ME
 
Thank you for the star.
The thing that gave me the fits was the number. It must be character and have the "-". In the second program my database shows "(417) 336-3688" for the number.


Jim
 
Hi Jim

After much effort trying to get the above to work, someone said, "What dial up connection are you using?". I said, "I'm not, I'm using broadband"

I didn't realise that WinFax requires a dial up connection to work (Doh!)

Anyway, the point is, I'll find one somewhere and post back. I'm sure other Tek-Tips users would be interested in this thread

Kindest regards
Lee....

VisFox Version 6 User / Windows ME
 
Lee

I didn't realise that WinFax requires a dial up connection to work (Doh!)

In fact it does support ISDN connection. From the WinFax specs
Class 1, Class 2, Class 2.0, or CAS-compatible fax modem; or fax-capable CAPI 2.0/G3 ISDN board



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks for that Mike. I'll have to dig deeper then with the settings.

I'm grateful to you
Lee...

VisFox Version 6 User / Windows ME
 
Well here's the response from Symantec:
Error: "Unable to load the CAPI driver..." when configuring ISDN modem without CAPI 2.0 Drivers

Situation:
When you configure an ISDN adapter, you see the following error message: "Unable to load the CAPI driver found on your system. Please ensure that your CAPI driver is properly installed or you will not be able to fax using ISDN." You do not have CAPI 2.0 drivers installed.

Solution:
The correct CAPI 2.0 driver must be installed for your ISDN adapter. Please contact the manufacturer of the modem for more details

I've sent a request because I'm not sure if the CAPI 2.0 driver is for the network adaptor or is Windows based.

I'll post again soon
Lee...

VisFox Version 6 User / Windows ME
 
Regarding my previous post
I've sent a request because I'm not sure if the CAPI 2.0 driver is for the network adaptor or is Windows based
it now appears that the CAPI 2.0 driver will only work with a high speed network adaptor (ISDN etc)

Therefore in view of that, we've now managed to resolve our issue by starting up WinFax, the user selecting the appropriate recipient, place the cursor in the "body" of the fax and using an old trick posted in Tek-Tips using CTRL+C (copy) from a memo field in VisFox and using CTRL+V (paste) into WinFax

Whilst this isn't a true "Automation" process it seems to do the job for the time being. I suppose when I have more time, I would very much like to look into Jim's very useful posts.

Just thought I'd update

Thanks again to those who posted
Lee

VisFox Version 6 User / Windows ME
 
Sorry I am late on the scene

TOPIC 1 -->> Just an observation

"jdhilljr (Programmer) Aug 9, 2004
Once you download the zip file. Run the executable called FaxDDE. With it open I ran my program and didn't even have winfax on my computer and was able to verify all the DDE info transmitted to be sure it followed acceptable parameters."

I didn't get the same response.. I did not have winfaxpro installed, I ran your program ... and it asked for FAXMNG32.EXE...

I then loaded WINFAXPRO and it no longer asked for it...

I suspect that Winfax must have been loaded there somewhere on your machine.


TOPIC 2

I found the same CAPI 2.0 problem...

I cant

I want to FAX from inside VFP and using ADSL link not dial up... I cant solve the CAPI issue... there are no CAPI drivers on the WINFAXPRO install disk

I am stumped

TOPIC 3 the real question

I have read a number of reviews for WINFAXPRO and they are not very complimentary.... in fact the phrase WINFAXSUCKS appears quite often... I must say that I have owned it for some time found it very tricky, unfriendly, unreliable and have barely used it ...


Can I ask... is there another way of FAXING from inside VFP ? (NOT WINFAXPRO, POSSIBLY EASIER ?)


Foxy


 
I found this in one of Mikes FAQ's FAQ184-1769

But does this really send a FAX ?

How to send a fax with an attachement.

Code:
objSession = CreateObject("Mapi.Session")
objSession.Logon ()
objMessage = objSession.Outbox.Messages.Add 
objMessage.Subject = "Test" 
objMessage.Text = "This is a test" 
objRecipient = objMessage.Recipients.Add 
objRecipient.Name = "[FAX:5555551111]" 
objRecipient.Type = 1 
objRecipient.Resolve ()
objMessage.Attachments.Add( "test.txt",0,  1, "C:\test.txt" )
objMessage.Send ()
objSession.Logoff

JF
 
Hi FoxEgg

Yes, your right about WinFax, although I'm not sure I would go as far to say "WinFaxSucks!!". It's not too bad, in fact for our project it was installed on a six user network and appears to work ok. However, I totally agree with you that it is difficult to find the answers and in particular passing data to WinFax variables. If we knew the answer to that one, the rest would be easy.
As I mentioned earlier, we've been able to Automate the process of copying the required information to a variable then pasting this into WinFax after VisFox starts it up.

Not the bext way I agree, but it works perfectly at the moment. In respect of CAPI 2.0 drivers, I have D-Link Network adaptor and sent a support request, this was the reply:
We do not have any CAPI 2.0 drivers for the DWL-650+. CAPI 2.0 drivers are usually for use with isdn devices the DWL-650+ is wireless cardbus adapter not an ISDN device.

I thought, "Thanks for that"

Anyway, your question, Can I ask... is there another way of FAXING from inside VFP ? (NOT WINFAXPRO, POSSIBLY EASIER ?) we await an answer.....

and

I found this in one of Mikes FAQ's FAQ184-1769
But does this really send a FAX ?


Have you tried it?

Lee....



VisFox Version 6 User / Windows ME
 
Thanks for the feedback...

I seem to remember that there are some third party fax services... ie send them an email and they make it become a fax and send it... I have never used them tho'


I have a INTEL PRO/100 network adaptor.. Dammed if I can find anything...CAPI 2.0 !!!!

I think I will put this in the Way Too Hard (for me) Department

Mike's code...it ran but then blew up VFP... error this and that (my fault not his, I am a VFP assassin)

One day someone will have an easy FAX program.. and there will much joy and merriment.

Cheers

John F

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top