Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending/Receiving faxes
Message
From
07/12/2005 10:21:31
 
 
To
07/12/2005 08:38:38
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01044886
Message ID:
01075722
Views:
26
Hello Raza, bellow find a method that I use to send faxes.
Here is how it works:

1) Users create a record in a sql server table along with the documents that they like to fax. The record store all necessary information, path to the file to fax, date and status ( has it been fax?).

2) I have an application running on a server that read this follow-up table and forward the faxes.

Here is the method that send the faxes:
PARAMETERS pcTo, pcFaxNumber, pcSubject, pcCoverSheet, pnFollowUpId, paFichEnviar, pcName
LOCAL gcOldDir
gcOldDir = SET('DEFAULT') + SYS(2003)

IF TYPE('pnFollowUpId') = 'L'
	=MESSAGEBOX("FollowUp_id is not Valid. EnviarFax() method",29,"Fax Transmission")
	RETURN .F.
ENDIF

*****************************************************************************
*-- Preceed to update the FollowUp table to reflect that the FAX was sent.
*-- Use pnFollowUpId to update record
lcArg = "msgsent = " + '"'+ ALLTRIM(STR(1)) + '"'
lcDisc = "nFollowUp_id = "+ '"' + ALLTRIM(STR(pnFollowUpId)) + '"'  
lcUpdateString = "usp_datahandler U , 'followup','"+lcArg+"' , '" + lcDisc + "' "
lnUpdateStatus = SQLEXEC(oApp.nConnectionHandle, lcUpdateString,'curRct')
IF !(IIF(lnUpdateStatus > 0 , .T., .F.))
	=MESSAGEBOX("Could't Update FollowUp table. Please contact Customer Support!",29,"Update Failed")
	RETURN .F.
ENDIF

oZfAPI       = CREATEOBJECT("zfAPI32.ZfAPI")
oUserSession = oZfAPI.Logon("SORTIZ", .f.)
oNewMessage  = oUserSession.CreateNewMsg()

lcUser = "Fulton Agency"

oNewMessage.Recipients.AddFaxRecipient(pcTo,lcUser, pcFaxNumber)
oNewMessage.Subject = pcSubject
oNewMessage.From = pcName
oNewMessage.Files.Add(paFichEnviar) && Add an Attachement
oNewMessage.Send() && Send the message

SET DEFAULT TO (gcOldDir)
Sergio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform