Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

win fax pro 1

Status
Not open for further replies.

lchase

Instructor
Aug 8, 2002
42
US
Does anybody have an example of using winfaxpro sdk form with access or vb.
Len
 
I've got one somewhere, though I can't seem to find it just now--I'll look tonight at home. Have you downloaded the documentation? It's quite helpful.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
I did download the documentation but I am not sure how the attachments and attachment objects as well as coverpage objects interact with the send object.
Len
 
Len,

If you post the code you're using, what you want to happen, and what is happening, I may be able to help you. It's been about a year since I used it, and it may take me a bit to find the dox, but I think I eventually got it down pretty decently.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
Value = sendObj.SetUseCover(1)
value = sendObj.SetCoverFile("c:\text.txt")
value = sendObj.SetCoverPage(CvpIndex)
I was trying to set a coverpage and add attachments

Value is just there to catch the return value if an error occurs.
The send objects works okay and starting winfax with in access and adding recipients is straight forward, but I don't get how to work with the coverpage and attachments.
I know I'm on the wrong track with this any help is appreciated.
Len
 
Here's some code I cut from one of my WinFax mailing list apps. The Me! references are to form text fields or combo boxes that the user fills in. I hope this helps.
Code:
Private Sub cmdSendFax_Click()
  Dim rst As Recordset
  Dim objSend As Object
  Dim sFile   As String
  Dim dtTemp1  As Date
  Dim dtTemp2  As Date
  Dim lBillCode As Long
  Dim lDateAdd  As Long
  Dim iCounter  As Integer
  Dim iMonth    As Integer
  Dim iDay      As Integer
  Dim iYear     As Integer
  Dim iWeekday  As Integer
  Dim vTemp   As Variant
  Dim Result
  
  On Error GoTo SendFax_Err
  DoCmd.Hourglass True
  'Check that the Cover Page file exists
  If Me!CoverType = 2 Then            'Cover Page
    sFile = Dir(Me!CoverFile)
    If sFile & "" = "" Then
      DoCmd.Hourglass False
      MsgBox "The Cover Page file '" & Me!CoverFile & "' is not found.", _
             vbOKOnly, "Schedule WinFax"
      GoTo SendFax_Exit
    End If
  End If
  'Check that the Attachment file exists
  If Me!AttachType <> 0 Then          'Attachment
    sFile = Dir(Me!AttachFile)
    If sFile & &quot;&quot; = &quot;&quot; Then
      DoCmd.Hourglass False
      MsgBox &quot;The Attachment file '&quot; & Me!AttachFile & &quot;' is not found.&quot;, _
             vbOKOnly, &quot;Schedule WinFax&quot;
      GoTo SendFax_Exit
    End If
  End If
  'Set up for submitting faxes to WinFax
  Set rst = CurrentDb.OpenRecordset(&quot;qryFbBrowseSel&quot;, dbOpenForwardOnly)
  iCounter = 0
  lDateAdd = 0
  vTemp = Me!SchedDate
  If Not IsNull(vTemp) Then
    dtTemp1 = Me!SchedDate
  End If
  'Go
  Do While Not rst.EOF
    Result = SysCmd(acSysCmdSetStatus, &quot;WinFax To: &quot; _
           & rst!RecipientName & &quot; at &quot; & rst!CompanyName)
    Set objSend = CreateObject(&quot;WinFax.SDKSend&quot;)
    objSend.SetClientID (&quot;Client Name&quot;)     'Must be first method invoked in order
                                            'to combine AddAttachmentFile and
                                            'SetPrintFromApp
    With objSend
      '--General:
      Result = .ResetGeneralSettings
      'Result = .RemoveAllRecipients
      'Result = .SetPreviewFax(0)
    
      '--Scheduling:
      iCounter = iCounter + 1
      If Me!SchedHoldYn = True Then
        Result = .SetHold(1)        'Overridden by SetDate/SetTime
      Else
        Result = .SetHold(0)
      End If
      If Me!SchedOffPeakYn = True Then
        Result = .SetOffPeak(1)     '1=Off Peak, 0=Anytime
      Else
        Result = .SetOffPeak(0)
      End If
      vTemp = Me!SchedDate
      If Not IsNull(vTemp) Then
        If iCounter > Me!SchedCount Then
          Select Case Me!SchedInterval
            Case 1    'Day
              lDateAdd = lDateAdd + 1
            Case 2    'Week
              lDateAdd = lDateAdd + 7
            Case 3    'Month
              iMonth = Month(Me!SchedDate)
              iDay = Day(Me!SchedDate)
              iYear = Year(Me!SchedDate)
              If iMonth < 12 Then
                iMonth = iMonth + 1
              Else
                iMonth = 1
                iYear = iYear + 1
              End If
              dtTemp2 = CDate(iMonth & &quot;/&quot; & iDay & &quot;/&quot; & iYear)
              lDateAdd = DateDiff(&quot;d&quot;, dtTemp1, dtTemp2)
          End Select
          iCounter = 1
        End If
        Result = .SetDate(Format(Me!SchedDate + lDateAdd, &quot;MM/DD/YY&quot;))
      End If
      vTemp = Me!SchedTime
      If Not IsNull(vTemp) Then
        Result = .SetTime(Format(Me!SchedTime, &quot;HH:MM:SS&quot;))
      End If
      
      '--To:
      'Result = .SetCountryCode (&quot;&quot;)
      Result = .SetAreaCode(AreaCodeFromPhone(rst!FaxNumber) & &quot;&quot;)
      Result = .SetNumber(NumberFromPhone(rst!FaxNumber) & &quot;&quot;)
      Result = .SetTo(rst!RecipientName & &quot;&quot;)
      Result = .SetCompany(rst!CompanyName & &quot;&quot;)
    
      '--Billing Code:
      'Result = .EnableBillingCodeKeyWords(1)
      'lBillCode = lBillCode + 22
      'Result = .SetBillingCode(lBillCode)
      'Result = .SetKeywords(&quot;Fax Blast&quot;)
    
      '--Cover Page:
      'Result = .SetSubject(&quot;&quot;)
      Result = .SetUseCover(0)
      Result = .SetQuickCover(0)
      If Me!CoverType <> 0 Then
        Result = .SetUseCover(1)
        Select Case Me!CoverType
          Case 1    'QuickCover
            Result = .SetQuickCover(1)
            'Result = .SetCoverText(Me!txtFaxCoverText)
          Case 2    'Cover Page
            Result = .SetQuickCover(0)
            Result = .SetCoverFile(Me!CoverFile)
        End Select
      End If
    
      '--Attachment or Report:
      If Me!AttachType <> 0 Then
        Select Case Me!AttachType
          Case 1    'Fax Attachment
            Result = .AddAttachmentFile(Me!AttachFile)
            If Result = 1 Then
              MsgBox &quot;Couldn't add attachment: &quot; & Me!AttachFile
            End If
          Case 2    'Application Document
            Result = .AddAttachmentFile(Me!AttachFile)
            If Result = 1 Then
              MsgBox &quot;Couldn't add attachment: &quot; & Me!AttachFile
            End If
        End Select
      End If
      Result = .ShowSendScreen(0)
      Result = .SetResolution(1)          '1=Fine, 0=Standard
      Result = .SetDeleteAfterSend(1)     '1=Delete, 0=Keep
      Result = .ShowCallProgress(0)       '1=Show, 0=Hide
    
      '--Add Recipient(s):
      Result = .AddRecipient()
      If Result = 1 Then
        MsgBox &quot;Couldn't add recipient: &quot; & Me!txtFaxContact
        GoTo SendFax_Exit
      End If
        
      '--Start faxing:
      Result = .Send(1)                   '1=Return EventID, 0=No EventID
      Do While .IsReadyToPrint() = 0
        DoEvents
      Loop
    
      Do While .IsEntryIDReady(0) <> 1
        DoEvents
      Loop
    
      Result = .Done
      Result = .LeaveRunning
      Set objSend = Nothing
    End With
  
NextRecipient:
    rst.MoveNext
  Loop
  
SendFax_Exit:
  On Error Resume Next
  rst.Close
  Set rst = Nothing
  Result = SysCmd(acSysCmdClearStatus)
  DoCmd.Hourglass False
  Exit Sub
  
SendFax_Err:
  DoCmd.Hourglass False
  MsgBox &quot;Error #&quot; & Err.Number & vbCrLf & vbCrLf & Err.Description, _
         vbOKOnly, &quot;cmdSendNow_Click&quot;
  Resume SendFax_Exit
End Sub
 
i know this is a real old thread but i'm having trouble with the winfax sdk. it's a vbscript/asp app on a win2k server. i'm attaching 2 files to the SDKSend object and sending the fax. everything works just fine except when i call the send() method the choose printer dialog pops up on the server and the fax won't go out until i click print. how do you suppress that printer dialog?
thanks,
mf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top