- This topic is empty.
-
AuthorPosts
-
April 12, 2005 at 2:00 pm #2641
Anonymous
MemberHi to all,
I create a fax using SDK, everythigns goes ok but I get two faxes, same image, same fax number ready to go.
Some times I get only one, but very often I get two.Do you know why ?
April 13, 2005 at 6:44 pm #4464Anonymous
Member@Vincenzo wrote:
Hi to all,
I create a fax using SDK, everythigns goes ok but I get two faxes, same image, same fax number ready to go.
Some times I get only one, but very often I get two.Do you know why ?
I would suggest you post your code that you are using, because if I remember correctly it had to do with a coding error not a problem in the SDK
April 14, 2005 at 8:00 am #4465Anonymous
Member@Moderator wrote:
I would suggest you post your code that you are using, because if I remember correctly it had to do with a coding error not a problem in the SDK
Here my code, thanx for your help
Dim sendObj As Object
Dim ret As Integer
Set sendObj = CreateObject("WinFax.SDKSend")
Call Sleep(2000)
If sendObj.SetClientID(App.Title) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetClientID")
End If
If sendObj.SetNumber( myfaxnumber ) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetNumber")
End If
If sendObj.SetTo(namepeopleto) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetTo")
End If
'imposto la ditta che deve ricevere
If sendObj.SetCompany(namefirmto) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetCompany")
End If
If Len(Trim(fp.Data)) > 0 Then
 If sendObj.SetDate(fp.Data) = 1 Then
  Call Err.Raise(9999, "SendFax", "Errore in SetDate")
 End If
End If
'Time in HH:MM:SS 24-hour format.
If Len(Trim(fp.Orario)) > 0 Then
 If sendObj.SetTime(fp.Orario) = 1 Then
  Call Err.Raise(9999, "SendFax", "Errore in SetTime")
 End If
End If
If sendObj.SetTypeByName("fax") = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetTypeByName")
End If
   Â
       Â
If sendObj.AddRecipient() = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in AddRecipient")
End If
 Â
Â
'lo si scrive anche se in realtà se gli si bassa 0 non va
If fp.SendCover And FileExists(fp.FileCopertina) Then
Â
 If sendObj.SetQuickCover(0) = 1 Then
  Call Err.Raise(9999, "SendFax", "Errore in SetQuickCover")
 End If
Â
 If sendObj.SetUseCover(1) = 1 Then
  Call Err.Raise(9999, "SendFax", "Errore in SetUseCover")
 End If
Â
 If sendObj.SetCoverFile(fp.FileCopertina) = 1 Then
  Call Err.Raise(9999, "SendFax", "Errore in SetCoverFile")
 End If
 Â
Else
 sendObj.SetQuickCover (0)
 sendObj.SetUseCover (0)
End If
If sendObj.SetResolution(0) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetResolution")
End If
If sendObj.EnableBillingCodeKeyWords(0) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in EnableBillingCodeKeyWords")
End If
If sendObj.SetSubject(fp.Subject) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetSubject")
End If
If sendObj.SetDeleteAfterSend(0) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetDeleteAfterSend")
End If
sendObj.SetPreviewFax (0)
Â
sendObj.ShowSendScreen (0)
sendObj.ShowCallProgess (0)
Â
Â
sendObj.LeaveRunning
Â
If sendObj.SetPrintFromApp(1) = 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in SetPrintFromApp")
End If
     Â
Dim volte As Integer
     Â
volte = 0
While sendObj.IsReadyToPrint() <> 1 And volte < 8
 volte = volte + 1
 Sleep (500)
Wend
If sendObj.IsReadyToPrint() <> 1 Then
 Call Err.Raise(9999, "SendFax", "Errore in IsReadyToPrint")
End If
Â
call PrintMyDocumentOnWinFAXPrinter
ret = sendObj.Send(1)
volte = 0
While sendObj.IsEntryIDReady(0) <> 1 And volte < 20
 volte = volte + 1
 Sleep (200)
Wend
If sendObj.IsEntryIDReady(0) = 1 Then
 LogError ("ID Fax " & sendObj.GetEntryID(0))
Else
 LogError ("Fax senza ID")
End If
sendObj.Done
  Â
Set sendObj = Nothing
April 14, 2005 at 3:57 pm #4466JohnD
ParticipantTry changing
volte = 0
While sendObj.IsReadyToPrint() <> 1 And volte < 8
volte = volte + 1
Sleep (500)
Wend
“And” to “or”
volte = 0
While (sendObj.IsReadyToPrint() <> 1) OR (volte < 8)
volte = volte + 1
Sleep (500)
Wend
do the same here:
volte = 0
While (sendObj.IsEntryIDReady(0) <> 1) OR (volte < 20)
volte = volte + 1
Sleep (200)
WendEdited By JohnD on April 14 2005 at 08:59
April 18, 2005 at 8:44 am #4467Anonymous
MemberJohnD wrote:thank you for your suggestions, I modified code and now I’m getting double faxes when the outbox is empty.
Better than before anyway 🙂
Do you know where I can see more code samples on how to manage fax with Winfax sdk ?April 18, 2005 at 1:45 pm #4468JohnD
Participant@Vincenzo wrote:
@JohnD wrote:
thank you for your suggestions, I modified code and now I’m getting double faxes when the outbox is empty.
Better than before anyway 🙂
Do you know where I can see more code samples on how to manage fax with Winfax sdk ?? Do you mean you only get a double-fax on the first fax ? and additional faxes are not double?
if the outbox is empty the first fax created is double?
April 18, 2005 at 3:28 pm #4469JohnD
ParticipantHere are some suggestions, I changed some order of the some of the SendObj commands you used.
Dim sendObj As Object
Dim ret As Integer
Set sendObj = CreateObject("WinFax.SDKSend")
Call Sleep(2000)
If sendObj.SetClientID(App.Title) = 1 Then
Call Err.Raise(9999, "SendFax", "Errore in SetClientID")
End If
If sendObj.SetNumber( myfaxnumber ) = 1 Then
Call Err.Raise(9999, "SendFax", "Errore in SetNumber")
End If
If sendObj.SetTo(namepeopleto) = 1 Then
Call Err.Raise(9999, "SendFax", "Errore in SetTo")
End If
'imposto la ditta che deve ricevere
If sendObj.SetCompany(namefirmto) = 1 Then
Call Err.Raise(9999, "SendFax", "Errore in SetCompany")
End If
If Len(Trim(fp.Data)) > 0 Then
If sendObj.SetDate(fp.Data) = 1 Then
-
AuthorPosts
- You must be logged in to reply to this topic.