Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatic replies...faxing
Message
De
17/01/2000 13:44:06
Paul De Niverville
Deniverville Econometric Research Ltd.
Victoria, Colombie Britannique, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00314652
Message ID:
00319109
Vues:
21
>Paul,
>My boss was wondering if you could email us a sample of how to do it.
>
>Thanks,
>Rick

Hi Rick,

Here is a copy/paste of the dde automation with notes.

For the dde syntax look at the enclosed web address. The dde syntax is probably very similar with all fax server/dde interfaces.

The program dde_fax gets called from a screen that allows the user to choose a type of client, range of client and fax time and date to send faxes.

There seems to be a problem with the fax date, but I think that will be solved with an upgrade from FACSys.

Paul


* program dde_fax.prg
*
* Documentation for the following DDE programming syntax can be found at
* http://www.facsys.com/indexed/tsb/ps96-400.htm
*
* table fax_sys.dbf created by a user determined select from tables in our client system.
* This code works in fpw 2.6 and vfp 5.0

GOTO TOP && of fax_sys.dbf

y = ddesetoption('safety',.F.) && eliminates message from foxpro
z = ddesetoption('timeout',20000) && gives more time for server to respond

x = DDEINITIATE("FACSYS","TRANSMIT")

IF x < 0
m.message = 'DDE connection to FACSys not available. No Faxes sent.'
DO message.spr
RETURN
ENDIF


DO WHILE NOT EOF() && step through fax_sys.dbf

m.phone = fax_sys.fax_number
m.name = SUBSTR(fax_sys.name,1,19)
m.legal_name = SUBSTR(fax_sys.legal_name,1,19)

* m.fax_hour, m.fax_min, m.fax_sec, m.fax_date get assigned in the screen tat calls this program
m.time = PADL(m.fax_hour,2,'0') +':'+ ;
PADL(m.fax_min,2,'0') +':'+ PADL(m.fax_sec,2,'0')

set date to mdy
set century off

* dde for FACSys still uses a 2 character year.
m.date = dtoc(m.fax_date)

set date to ansi
set century on

* AA = ddepoke(x,"sendfax","ddeholdon")
* documentation is not right for this one.

IF m.fax_now && m.fax_now gets assigned in the label screen
A = DDEPOKE(x,"sendfax",'recipient("&phone",,,"&name","&legal_name")')
ELSE
* There is a problem with the date in dde transfer to facsys beginning in year 2000.
* FACSys suggested upgrading to a newer version of their software.
* For now, users can still schedule for overnight transmission using the time option.
* A = DDEPOKE(x,"sendfax",'recipient("&phone","&time","&date","&name","&legal_name")')
* testing prpblem with date without macro substitution, still a problem.
* A = DDEPOKE(x,"sendfax",'recipient("&phone","&time","01/13/00","&name","&legal_name")')
A = DDEPOKE(x,"sendfax",'recipient("&phone","&time",,"&name","&legal_name")')
ENDIF

IF NOT A
m.message = 'Sendfax recipient statement did not work for: '+m.legal_name
DO message.spr
EXIT
ENDIF

* remember facsys needs the complete file name
* unless it is in the facsys root directory

* C = DDEPOKE(x,"sendfax",'attach("c:\clients\testword.prn")')

C = DDEPOKE(x,"sendfax",'attach("&b")')

IF NOT C
m.message = 'Sendfax attach statement did not work for: '+m.legal_name
DO message.spr
EXIT
ENDIF

D = DDEEXECUTE(x,'sendnow')

IF NOT D
m.message = 'DDEexecute statement did not work for: '+m.legal_name
DO message.spr
EXIT
ENDIF


SKIP 1
ENDDO

F = DDETERMINATE(x)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform