Hello All,
I have a db with 100's of faxno's.
I need to read thru my DB and send a fax to each of these no's automatically using a VB program.
The fax software I am using is Winfax Pro v.8.01.
Can anyone help me to get this going!!??
Thanks,
T
Printable View
Hello All,
I have a db with 100's of faxno's.
I need to read thru my DB and send a fax to each of these no's automatically using a VB program.
The fax software I am using is Winfax Pro v.8.01.
Can anyone help me to get this going!!??
Thanks,
T
...to get me to the top...
send me an e-mail at [email protected]... I'll zip a 3k file demo of faxdemo.zip I got a while back...
Your e-mail is not displayed on this site..
I have not had a chance to look into it yet... but it used CDO (Collaboration Data Objects)
This is how I faxed a word document. Use what code you need. Hope this helps.
Joe
VJobId = 0
Set FS = CreateObject("FaxServer.FaxServer")
Dim ServerName As String
'ServerName = "local"
ServerName = "\\jcourch1"
'ServerName = "\\MyServer"
FS.Connect (ServerName)
Dim FileName As String
FileName = App.Path & "\TEMPVEHREG1.doc"
'FileName = "tempvehreg1.doc"
Set FD = FS.CreateDocument(FileName)
vJobComplete = False
Dim vIsItaFileYet As Boolean
While Not vIsItaFileYet
'Check to see if Word has written the file yet
Dim vFileStatus As Long
Dim joe As WIN32_FIND_DATA
vFileStatus = FindFirstFile&("c:\winnt\system32\FaxComm.txt", joe)
If vFileStatus >= 1 Then
vIsItaFileYet = True
End If
Wend
Dim vDetail As Integer
Open "c:\winnt\system32\faxcomm.txt" For Input As #1
Input #1, vDetail
vFaxIdNbr = vDetail
Close #1
'get Fax Number
GetFaxNumber
'StatusBar1.Panels(2).Text = "8,(480)443-8412"
StatusBar1.Panels(2).Text = vRecipientPhoneNbr
FD.FaxNumber = vRecipientPhoneNbr
Dim JobId As Long
JobId = FD.Send() 'This sends the fax
VJobId = JobId 'Set variable = jobid for update later
Dim lCount As Long
Set FJS = FS.GetJobs()
For lCount = 1 To FJS.Count
Set FJ = FJS.Item(lCount)
If (FJ.JobId = JobId) Then
Do Until vJobComplete = True
strDevStat = " "
vReasonCode = ""
'Sleep (600)
FJ.Refresh
strDevStat = FJ.DeviceStatus
'MsgBox strDevStat
Select Case strDevStat
Case "Dialing"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = False
update_FaxLog
Case "Sending"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = False
update_FaxLog
Case "Initializing"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = False
update_FaxLog
Case "Completed":
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Set FJ = Nothing
Set FS = Nothing
Set FJS = Nothing
Set FD = Nothing
Set objectWord = Nothing
Close_Windows
vCheckFaxDBTF = True 'Turn Timer Back On
StatusBar1.Panels(3).Text = "Fax Timer On"
Exit Sub
Case "Complete":
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Set FJ = Nothing
Set FS = Nothing
Set FJS = Nothing
Set FD = Nothing
Set objectWord = Nothing
Close_Windows
vCheckFaxDBTF = True 'Turn Timer Back On
StatusBar1.Panels(3).Text = "Fax Timer On"
Exit Sub
Case "Busy"
'Sleep 600
update_FaxLog
vCheckFaxDBTF = True 'Turn Timer Back On
StatusBar1.Panels(3).Text = "Fax Timer On"
Case "Unknown"
Case "Available"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Fax_aborted
Exit Sub
Case "Cancelled Fax Call"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Fax_aborted
Exit Sub
Case "Aborting"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Fax_aborted
Exit Sub
Case "Not a Fax Call"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Fax_aborted
Exit Sub
Case "Unavailable"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Fax_aborted
Exit Sub
Case "No Answer"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Fax_aborted
vCheckFaxDBTF = True 'Turn Timer Back On
StatusBar1.Panels(3).Text = "Fax Timer On"
Exit Sub
Case "Bad Address"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
Fax_aborted
vCheckFaxDBTF = True 'Turn Timer Back On
StatusBar1.Panels(3).Text = "Fax Timer On"
Exit Sub
Case "No Dial Tone"
StatusBar1.Panels(1).Text = strDevStat
vJobComplete = True
vReasonCode = strDevStat
update_FaxLog
vCheckFaxDBTF = True 'Turn Timer Back On
StatusBar1.Panels(3).Text = "Fax Timer On"
Fax_aborted
Exit Sub
Case Else
StatusBar1.Panels(1).Text = strDevStat
vReasonCode = strDevStat
MsgBox vReasonCode
vJobComplete = True
update_FaxLog
Fax_aborted
Exit Sub
End Select
Loop
End If
Next
End Sub
Private Sub Fax_aborted()
Dim Command As Long
Const JC_DELETE As Long = 1
Command = JC_DELETE
FJ.SetStatus (Command)
vReasonCode = strDevStat
vJobComplete = True
Set FJ = Nothing
Set FS = Nothing
Set FJS = Nothing
Set FD = Nothing
Set objectWord = Nothing
Close_Windows
End Sub
Thanks guys!!