Salut à tous,
J'ai un soucis dans ma boucle, il m'envoi le premier fax, recommence à envoyer le premier fax, puis passe au deuxieme, reviens au premier, passe au deuxieme, au troisieme, reviens au premier, comme si il remettait a zéro le varItem chaque fois qu'il change de destinataires de ma liste ListeFax.
Merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 Private Sub Commande86_Click() Dim objFaxServer As New FAXCOMEXLib.FaxServer Dim objFaxDocument As New FAXCOMEXLib.FaxDocument Dim objSender As FaxSender Dim JobID As Variant Dim varItem As Variant Dim path As String path = FindFax("c:\") Dim pathcov As String pathcov = FindCov("C:\Documents and Settings\All Users\Application Data\Microsoft\Windows NT\MSFax\Common Coverpages\") For varItem = 0 To Me.ListeFax.ListCount - 1 'Connect to the fax server objFaxServer.Connect "" 'Set the fax body objFaxDocument.Body = path 'Name the document objFaxDocument.DocumentName = "Fax Atlantique" 'Add the recipient with the fax number 12225550100 objFaxDocument.Recipients.Add "'" & Me.ListeFax.ItemData(varItem) & "'", "" 'Choose to attach the fax to the fax receipt objFaxDocument.AttachFaxToReceipt = True 'Set the cover page type and the path to the cover page objFaxDocument.CoverPage = pathcov 'Set the sender properties. objFaxDocument.Sender.Title = "Mr." objFaxDocument.Sender.Name = "Jean-Pierre " 'Save sender information as default objFaxDocument.Sender.SaveDefaultSender 'Submit the document to the connected fax server 'and get back the job ID. JobID = objFaxDocument.ConnectedSubmit(objFaxServer) Next varItem End Sub![]()
Partager