Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

How could I FAX a report ?

edited October 2001 in General
How could I FAX a report by using RB6 ? If it possible, how to link the FAX
numbers from a table field ?

Thanks

Comments

  • edited October 2001
    You can use an application such as Symantec's WinFax, to fax a report. We
    haven't researched faxing to the extent that the fax number is pulled from
    the database and sent to the faxing application.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited October 2001
    Hello Peter,

    Here's some code you can use to fax your report.
    It works with D5 and WinFax 8/9/10, but I didn't tried it with D6.

    // This code is assuming that you will print to the winfax driver.
    // WinFax is of type variant.

    try
    WinFax := CreateOleObject('WinFax.SDKSend');
    except
    ShowMessage('Could not start Win Fax');
    end;

    WinFax.LeaveRunning;

    if WinFax.AddAttachmentFile('')=1 then ShowMessage('Could not add
    file');
    if WinFax.SetPrintFromApp(1) = 1 then ShowMessage('Failed
    Setprint');

    WinFax.SetTo(to);

    { Set the fax number in winfax }
    if WinFax.SetNumber(TelNumber) = 1 then ShowMessage('Could not set
    number');
    if WinFax.SetAreaCode(AreaCode) = 1 then ShowMessage('Could set
    area code');

    if WinFax.AddRecipient = 1 then ShowMessage('Could not add fax
    recipient');
    if WinFax.SetPreviewFax(0) = 1 then ShowMessage('Could not set
    preview');
    if WinFax.SetUseCover(0)=1 then ShowMessage('Could not set use
    cover');
    if WinFax.SetResolution(0) = 1 then ShowMessage('Could not set
    resolution');

    WinFax.Send(1);

    { Wait for the fax program to get ready }

    while WinFax.IsReadyToPrint = 0 do ;
    { **** Now print to the fax Driver ******}
    sleep(100); { need this to allow winfax to run Without this
    there will be times when winfax will ask for
    the fax number to call }

    { Wait for an ID from win fax }
    while(WinFax.IsEntryIDReady(0)=0) do;
    id := WinFax.GetEntryID(0);

    WinFax.Done;
    WinFax.unassign;
    { ===================================== }

    Best regards,

    David Narodetsky
    yan_dn@netvision.net.il

    Live Long... Code Well... and Prosper!
  • edited October 2001

This discussion has been closed.