Sending a Fax using DDE from VFP using WinFax 4.0

Sending a Fax using DDE from VFP using WinFax 4.0

Post by Curtis Frazier, J » Tue, 10 Jun 1997 04:00:00



If you ever figure this one out, could you e-mail me the response.
I'm trying the same in VB.

On 9 Jun 1997 20:16:41 GMT, "Walter Savinovich"


>Can anyone help with this problem I have?

>I am attempting to fax from within my VFP application using WinFax. Unless
>I've made a serious oversight, I am following the documentation for both
>VFP and WF to the letter. The funtion I created seems to work correctly,
>specially when I step through the actual funtion to determine whether the
>DDE connection is working properly. Yet as much as I try, I have not been
>able to actually get a fax leave my computer.

>Below is the function I am using to send a fax. If anyone sees an obvious
>error, or may have a better suggestion, please let me know.

>TIA

>--
>======================================
>Walter Savinovich
>Contracting for Logistics Planning
>American Honda Motor Co., Inc.

>*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

>function sendafax
>    parameters faxnumber,;
>            faxtime,;
>            faxdate,;
>            faxname,;
>            faxcompany,;
>            faxsubject,;
>            faxkeywords,;
>            faxbillingcode,;
>            faxcover,;
>            faxattach
>    faxedok=.f.
>    thefaxmessage=""
>    mChannelNum = DDEInitiate("FAXMNG","TRANSMIT")
>    if mChannelNum>0    
>            theddecommand="recipient("
>            theddecommand=theddecommand+chr(34)+alltrim(faxnumber)+chr(34)+","
>            theddecommand=theddecommand+chr(34)+alltrim(faxtime)+chr(34)+","
>            theddecommand=theddecommand+chr(34)+alltrim(faxdate)+chr(34)+","
>            theddecommand=theddecommand+chr(34)+alltrim(faxname)+chr(34)+","
>            theddecommand=theddecommand+chr(34)+alltrim(faxcompany)+chr(34)+","
>            theddecommand=theddecommand+chr(34)+alltrim(faxsubject)+chr(34)+","
>            theddecommand=theddecommand+chr(34)+alltrim(faxkeywords)+chr(34)+","
>            theddecommand=theddecommand+chr(34)+alltrim(faxbillingcode)+chr(34)+")"
>            thefaxmessage=thefaxmessage+"Sendfax - "+theddecommand+chr(13)
>            if !DDEPoke(mChannelNum,"Sendfax",(theddecommand) )
>                    wait "Fax message failed with DDE error
>"+alltrim(str(DDELasterror()))+"." window
>            else
>                    theddecommand="setcoverpage("
>                    theddecommand=theddecommand+chr(34)+faxcover+chr(34)+")"
>                    thefaxmessage=thefaxmessage+"Sendfax - "+theddecommand+chr(13)
>                    if DDEPoke(mChannelNum,"Sendfax",theddecommand)
>                            theddecommand="attach("
>                            theddecommand=theddecommand+chr(34)+faxattach+chr(34)+")"
>                            thefaxmessage=thefaxmessage+"Sendfax - "+theddecommand+chr(13)
>                            if DDEPoke(mChannelNum,"Sendfax",theddecommand)
>                                    theddecommand="resolution("
>                                    theddecommand=theddecommand+chr(34)+"HIGH"+chr(34)+")"
>                                    thefaxmessage=thefaxmessage+"Sendfax - "+theddecommand+chr(13)
>                                    if DDEPoke(mChannelNum,"Sendfax",theddecommand)
>                                            theddecommand="showsendscreen("
>                                            theddecommand=theddecommand+chr(34)+"1"+chr(34)+")"
>                                            thefaxmessage=thefaxmessage+"Sendfax - "+theddecommand+chr(13)
>                                            if !DDEPoke(mChannelNum,"Sendfax",theddecommand)
>                                                    wait "Fax message failed with DDE error
>"+alltrim(str(DDELasterror()))+"." window
>                                            endif
>                                    else
>                                            wait "Fax message failed with DDE error
>"+alltrim(str(DDELasterror()))+"." window
>                                    endif
>                            else
>                                    wait "Fax message failed with DDE error
>"+alltrim(str(DDELasterror()))+"." window
>                            endif
>                    else
>                            wait "Fax message failed with DDE error
>"+alltrim(str(DDELasterror()))+"." window
>                    endif
>            endif
>            faxedok=.t.    
>            =DDETerminate(mchannelnum)
>            =messagebox(thefaxmessage,48,thesystemname)
>    endif
>    return faxedok

>--
>======================================
>Walter Savinovich
>Contracting for Logistics Planning
>American Honda Motor Co., Inc.