- This topic is empty.
-
AuthorPosts
-
September 9, 2003 at 5:55 pm #2519
mizatch
MemberI have written the vb.net code below. Basically I loop through a dataset of faxes that need to be sent. At the time of faxing, I run this code which then loops through a list of attachments that need to be sent to this person. That all works fine – the fax seems to be sent perfectly to WinFax. My problem is that when I call the “.GetEntryID(0)” it will always pull the EntryID from the first fax sent to WinFax. Can anyone tell what I’m doing wrong in this code? I’m using the “.IsEntryIDReady(0)” and WinFax does seem to have an EntryID ready, but it is not always the updated ID#. Any help is greatly appreciated.
Dim objwinfaxsend2 As New wfxctl32.CSDKSend()
With objwinfaxsend2
Dim CurrentId, NewId As String
CurrentId = .GetEntryID(0)
NewId = .GetEntryID(0).SetHold(0)
.SetDate(Date.Today)
.SetTime(Format(Date.Today, “HH:mm:ss”))
.SetDeleteAfterSend(1)
.SetOffPeak(0)
.SetUseCover(0)
.SetNumber(CStr(“9935454”))
.SetDeleteAfterSend(1)
.SetTo(DsMain1.Tables(“Employer”).Rows(0).Item(“Employer_First_Name”) & ” ” & DsMain1.Tables(“Employer”).Rows(0).Item(“Employer_Last_Name”))
.SetCompany(DsMain1.Tables(“Employer”).Rows(0).Item(“Company_name”))‘Loop through attachment table if there are any attachments
If DsMain1.Tables(“Fax_Email_Attachment”).Rows.Count > 0 Then
Dim drAttach As DataRow
For Each drAttach In DsMain1.Tables(“Fax_Email_Attachment”).Rows
.AddAttachmentFile(drAttach.Item(“Attachment_Path”))
Next
End If.AddRecipient()
Dim ret As String = .Send(1)
If ret <> 0 Then
MsgBox(“There was an error sending the fax job to WinFax”, vbOKOnly)
Exit Sub
Else
‘MsgBox(“Fax has been sent!”, vbInformation)
End If‘Wait for the Fax ID be ready
Do Until .IsEntryIDReady(0) = 1
System.Windows.Forms.Application.DoEvents()
Loopdr.Item(“Fax_Id”) = .GetEntryID(0)
FaxQueueDataAdapter.Update(DsMain1).Done()
objwinfaxsend2 = Nothing
End With
-
AuthorPosts
- You must be logged in to reply to this topic.