Fax Software

Community Forums

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2741
    lynniek
    Member

    I have the following code I pieced together from several posts I have seen. I am sorry I can’t credit the developer(s). I am trying to print a filtered report to WinFax filling in the cover page with data from an Access form. This is working but not together. Meaning I get one cover page with name, fax number and company filled in and it automatically sends. I get another cover page (basic) with the report attached. This one stays on the screen (doesn’t automatically send) and no information is filled in (fax number, company, name). Both of these things are happening when I click the button that runs this code.

    PLEASE help. I have been going around and around with this code.

    ‘***Start code****
    Dim objWinfaxSend As New wfxctl32.CSDKSend
    Dim RetCode As Long
    ‘Set objWinfaxSend = CreateObject(“WinFax.SDKSend8.0”)
    RetCode = objWinfaxSend.SetClientID(Me.Customer)

    ‘Begin Recipient Settings
    Application.Printer = Application.Printers(“WinFax”)
    gstrReportFilter = “QuoteID = ” & Me.QuoteID
    DoCmd.OpenReport “RPT_QuoteDetailsTotalWF”, , , gstrReportFilter
    RetCode = objWinfaxSend.SetTo(Me.contactname)
    RetCode = objWinfaxSend.SetNumber(Me.CustomerFax)
    RetCode = objWinfaxSend.SetSubject(“Quote”)
    RetCode = objWinfaxSend.SetCompany(Me.Customer) ‘
    ‘Destination
    RetCode = objWinfaxSend.SetDeleteAfterSend(0) ‘ Do Not Delete
    RetCode = objWinfaxSend.SetQuickCover(1) ‘ Yes
    ‘RetCode = objWinfaxSend.SetUseCover(1) ‘ Yes to Include a cover
    RetCode = objWinfaxSend.SetCoverText(“Quoted by RIL”)
    ‘RetCode = objWinfaxSend.SetCoverFile(“C:ProgramFilesWinFaxCoverBasic1.CVP”)
    RetCode = objWinfaxSend.AddRecipient
    RetCode = objWinfaxSend.ShowCallProgess(1)
    RetCode = objWinfaxSend.Send(1)
    RetCode = objWinfaxSend.LeaveRunning ‘ This will leave Winfax controller running.

    Do While objWinfaxSend.IsReadyToPrint = 0
    DoEvents
    Loop
    ‘****END CODE****

    🙁

    #4699
    Anonymous
    Member

    ok, there are a few items missing in your code if you want to print to the WinFax PRO printer driver (to fax a report from Access). The first is SetPrintFromApp(1) is required, and you need to print to the WinFax PRO printer after you set the recipient details (not before). I’ve also added the code to wait until an entry id is ready before moving on.



    Dim objWinfaxSend As New wfxctl32.CSDKSend
    Dim RetCode As Long
    'Set objWinfaxSend = CreateObject("WinFax.SDKSend8.0")

    RetCode = objWinfaxSend.SetClientID(Me.Customer)

    'Begin Recipient Settings

    RetCode = objWinfaxSend.SetTo(Me.contactname)
    RetCode = objWinfaxSend.SetNumber(Me.CustomerFax)
    RetCode = objWinfaxSend.SetSubject("Quote")
    RetCode = objWinfaxSend.SetCompany(Me.Customer)           '
    'Destination
    RetCode = objWinfaxSend.SetDeleteAfterSend(0)   ' Do Not Delete
    RetCode = objWinfaxSend.SetQuickCover(1)         ' Yes
    'RetCode = objWinfaxSend.SetUseCover(1)         ' Yes to Include a cover
    RetCode = objWinfaxSend.SetCoverText("Quoted by RIL")
    'RetCode = objWinfaxSend.SetCoverFile("C:ProgramFilesWinFaxCoverBasic1.CVP")


    RetCode = objWinfaxSend.AddRecipient

    RetCode = objWinfaxSend.ShowCallProgess(1)
    RetCode = objWinfaxSend.SetPrintFromApp(1)
    RetCode = objWinfaxSend.Send(1)

    RetCode = objWinfaxSend.LeaveRunning   ' This will leave Winfax controller running.

    Do While objWinfaxSend.IsReadyToPrint = 0
     DoEvents
    Loop

    Application.Printer = Application.Printers("WinFax")
    gstrReportFilter = "QuoteID = " & Me.QuoteID
    DoCmd.OpenReport "RPT_QuoteDetailsTotalWF", , , gstrReportFilter

    ' Wait until the EntryID is ready before moving on.
    ' the Send(1) you specified before is used here.
    ' We don't care what the EntryID is,
    ' we just want to know that is it ready.  
    ' this loop will wait but allow background processing to continue
    ' when ready IsEntryIDReady is not = to 1

     Do While objWinfaxSend.IsEntryIDReady(0) <> 1
        DoEvents
     Loop

    I don’t have Access to test but this should work with WinFax PRO 10.03 or 10.04

    Edited By Moderator on 1158888385

    #4700
    lynniek
    Member

    Thank you so much for the code revisions. Unfortunately it still does not work. I get one cover page with the report attached but the name, fax number, etc. do not pull from Access and fill out the cover page.

    Any other thoughts would be appreciated.

    #4701
    Anonymous
    Member

    I would suggest hard coding the name, number etc. (replacing the Me.CustomerFax, Me.Contact) variables in your code for testing purposes only. This will confirm if the faxing (SDK) portion is working and not a specific problem with your access database (getting the name & number) from Access.

    #4702
    lynniek
    Member

    I tried hard coding the name and fax number. This information did not make it to Winfax either. When the cover page appears, the report is attached and the fields show @R for name, @C for company, @X for fax number. After a one or two second delay, the @ in each field changes to , , and . I have tried clicking send thinking maybe it was just not previewing correctly but I get a message that the fax is not addressed to anyone.

    Any other thoughts are appreciated.

    🙁

    #4703
    Anonymous
    Member

    Are you showing the SendScreen using ShowSendScreen(1) ?
    because then this is working as designed. Cover page data variables only operate when ShowSendScreen is disabled using the ShowSendScreen(0) SDK function or DDE ShowSendScreen(“0”) command.

    By default the ShowSendScreen command is set to 0, and since I didn’t see it in your code I assumed you are not viewing the send screen after you create the report.

    #4704
    lynniek
    Member

    I did have the “RetCode = objWinfaxSend.ShowCallProgess(1)” code typed. I deleted that line and still have the same issue. Attachment with cover page and no variable data inserted.

    #4705
    Anonymous
    Member

    @lynniek wrote:

    I did have the “RetCode = objWinfaxSend.ShowCallProgess(1)” code typed. I deleted that line and still have the same issue. Attachment with cover page and no variable data inserted.

    you shouldn’t be seeing the send dialog box at all, if this appears, then something else is wrong. You mighr want to try adding ShowSendScreen(0) in your code.

    The ShowCallProgress(1) command only displays the send status window while the fax is being sent, it doesn’t turn the send dialog box on or off.

    #4706
    lynniek
    Member

    I added that line (ShowSendScreen(0) ). Starting to think that it is just not going to work.

    Thanks for you thoughts. I also tried the DDE example from Helen Feddema. This works to get the information (fax number, customer) from Access into WinFax but again, the attachment doesn’t appear. I see it generate and it makes it to the Print Que. Never makes it to WinFax.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.