To use fax with FWH

Post Reply
User avatar
damianodec
Posts: 372
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia
Contact:

To use fax with FWH

Post by damianodec »

I would like send my fax by FWH
are there any example?
can anybody help me?
thanks
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Code: Select all

*
* ----------------------------------------------------------------
*
...
   DEFINE BUTTON ... ACTION WinFaxDDE(oWnd,"c:\autoexec.bat","55-11-6651-1629","","","FAX Comercial","Nome da Emmpresa",;
                  "Teste de envio","","","FAX")
...

Function WinFaxDDE(oWnd,FaxFile,FaxNumber,SendTime,SendDate,FaxName,Company,;
                   Subject,Keyword,BillingCode,Modo)
   DEFAULT FaxFile    := "c:\prova.doc" ,;
           FaxNumber  := "4432-4081"    ,;
           SendTime   := ""             ,;
           SendDate   := ""             ,;
           FaxName    := "FAXKonectiva" ,;
           Company    := "Konectiva"    ,;
           Subject    := "Teste de FAX" ,;
           keyword    := ""             ,;
           BillingCode:= ""             ,;
           Modo       := "Fax"

   if oWinFaxDDE == nil
      oWinFaxDDE:=TDDE():New(OWND,"FAXMNG32","CONTROL")
      oWinFaxDDE:Activate()
      ?MsgInfo( "Ativando o WinFAX" )
   else
      ?MsgInfo( "WinFAX ja esta ativado" )
   endif
   oWinFaxDDE:Execute( "GoIdle" )
   oWinFaxDDE:end()

   oWinFaxDDE1:=TDDE():New(OWND,"FAXMNG32","TRANSMIT")
   oWinFaxDDE1:Activate()

   rec := "recipient("+chr(34)+;
          FaxNumber+chr(34)+","+chr(34)+;
          SendTime+chr(34)+","+chr(34)+;
          SendDate+chr(34)+","+chr(34)+;
          FaxName+chr(34)+","+chr(34)+;
          Company+chr(34)+","+chr(34)+;
          Subject+chr(34)+","+chr(34)+;
          keyword+chr(34)+","+chr(34)+;
          BillingCode+chr(34)+","+chr(34)+;
          modo+chr(34)+")"

   //oWinFaxDDE1:Poke(1,"sendfax",rec)
   //oWinFaxDDE1:Poke(1,"sendfax","attach("+chr(34)+faxfile+chr(34)+")",5)
   //oWinFaxDDE1:Poke(1,"sendfax","SendfaxUI")
   oWinFaxDDE1:Execute( rec )
   oWinFaxDDE1:Execute( 'attach('+chr(34)+faxfile+chr(34)+')' )
   oWinFaxDDE1:Execute( "GoIdle" )
   oWinFaxDDE1:Execute( "SendFaxUI" )
   oWinFaxDDE1:end()

   oWinFaxDDE2:=TDDE():New(OWND,"FAXMNG32","CONTROL")
   oWinFaxDDE2:Activate()
   oWinFaxDDE2:Execute( "GoActive" )
return nil
You need activate XP or Windows 2000/2003 Fax service.
Post Reply