Fax Software

Community Forums

This topic contains 2 replies, has 0 voices, and was last updated by  Anonymous 15 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2632

    Anonymous
    Member

    I have been trying to program automated faxing from my Access 2000 application using VBA and the Winfax SDK. I am using version 9 of Winfax. My problem is that the 1st time I try to fax from my application after starting it, Winfax delivers its cover page to be filled in. Every time after the first time, it works fine.

    Any help would be appreciated. Here is my function that sends an Access report to Winfax. (BTW, no cover page is supposed to be generated.)

    Public Function SendFax(strReportName As String, strReportWhere As String, strSubject As String, _
    aryRecipientName() As String, aryRecipientTelNo() As String, aryRecipientCompany() As String) As Boolean
    Dim objSendFax As Object, X As Integer, intUBound As Integer, RetCode As Variant
    SendFax = False
    intUBound = UBound(aryRecipientName)
    strOrigDefaultPrinter = GetDefaultPrinter
    If Not SetDefaultPrinter(“WinFax”) Then
    MsgBox “Cannot find a ‘WinFax’ printer configured on this computer.” & vbCrLf & _
    “Therefore cannot fax.”, vbOKOnly, “Can not fax.”
    Exit Function
    End If
    Set objSendFax = CreateObject(“Winfax.SDKSend”)
    With objSendFax
    RetCode = .ResetGeneralSettings
    For X = 0 To intUBound
    RetCode = .SetAreaCode(“”)
    RetCode = .SetCountryCode(“”)
    RetCode = .SetDialPrefix(“”)
    RetCode = .SetTo(aryRecipientName(X))
    RetCode = .SetNumber(aryRecipientTelNo(X))
    RetCode = .SetExtension(“”)
    RetCode = .SetPreviewFax(0)
    RetCode = .EnableBillingCodeKeyWords(0)
    RetCode = .SetUseCover(0)
    RetCode = .SetUseCreditCard(0)
    RetCode = .SetResolution(1)
    RetCode = .SetUsePrefix(0)
    RetCode = .SetDeleteAfterSend(0)
    RetCode = .SetSubject(strSubject)
    RetCode = .SetCompany(aryRecipientCompany(X))
    RetCode = .ShowCallProgress(1)
    RetCode = .SetPrintFromApp(1)
    If .AddRecipient() = 1 Then
    MsgBox “Could not add recipient.”, vbOKOnly
    Exit Function
    End If
    Next X
    RetCode = .Send(0)
    RetCode = .showsendscreen(0)
    Do While .isreadytoprint = 0
    DoEvents
    Loop
    .done
    End With
    DoCmd.OpenReport strReportName, acViewPreview, , strReportWhere
    DoCmd.PrintOut acPrintAll
    DoCmd.Close acReport, strReportName
    SendFax = True
    ExitSendFax:
    If Not SetDefaultPrinter(strOrigDefaultPrinter) Then
    MsgBox “Can not restore the original default printer.” & vbCrLf & _
    “Please check your printer settings.”, vbOKOnly, “Error!”
    End If
    Set objSendFax = Nothing
    End Function

    #4443

    Anonymous
    Member

    Try removing this code, as it is specific to cover pages

    RetCode = .SetSubject(strSubject)
    RetCode = .SetCompany(aryRecipientCompany(X))

    also remove this:

    RetCode = .EnableBillingCodeKeyWords(0)

    #4444

    Anonymous
    Member

    Thank you. It worked!

    Jerry

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.