• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 339
  • Last Modified:

Sample code to send winfax from access

I am looking for some sample code to be able to send reports out by using winfax.  Currently Winfax is the only program that we have to send faxes out.  I am looking for a way to automate it.  Currently we only use MSAccess for our database.
0
hpfam
Asked:
hpfam
1 Solution
 
yhwhlivesinmeCommented:
Taken from: http://www.experts-exchange.com/Databases/MS_Access/Q_21244188.html

Function TestFax()

Dim objWinFaxSend As Object
Dim strDate As String
Dim strTime As String
Dim strSetTo As String
Dim intCust As Integer
Dim intCounter As Long

intCust = 0

strSetTo = "My Customer Name"
strDate = Format(DATE , "mm/dd/yy")
strTime = Format(Now(), "hh:mm:ss")

Do While intCust < 3

Set objWinFaxSend = CreateObject("Winfax.SDKSend")
objWinFaxSend.SetSubject ("Test Fax")
objWinFaxSend.SetNumber ("1234567")
objWinFaxSend.SetAreaCode ("713")
objWinFaxSend.SetTo (strSetTo)
objWinFaxSend.SetDate (strDate)
objWinFaxSend.SetTime (strTime)
objWinFaxSend.SetCompany ("Commercial Chemical")
objWinFaxSend.AddRecipient
objWinFaxSend.SetPrintFromApp (1)
objWinFaxSend.Send (1)
objWinFaxSend.ShowSendScreen (0)

    Do While objWinFaxSend.IsReadyToPrint = 0
    DoEvents
    Loop

DoCmd.OpenReport "MyReport", acViewNormal

intCust = intCust + 1

objWinFaxSend.Done

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

Set objWinFaxSend = Nothing
DoEvents

Loop

End Function
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now