Valeur Progressbar durant le temps d'envoi d'un email

cs_amita Messages postés 151 Date d'inscription samedi 17 juillet 2004 Statut Membre Dernière intervention 11 mai 2012 - 9 mars 2011 à 23:34
cs_patosch Messages postés 42 Date d'inscription jeudi 20 septembre 2007 Statut Membre Dernière intervention 26 juin 2013 - 10 mars 2011 à 13:43
mes amis voici mon problème :
je souhaite faire avancer un progressbar selon le temps de l'envoi d'un email mais j'arrive pas, voici la fonction

Public Sub envoiCDO()
'On Error GoTo err
Dim oCDO
ResultatEnvoi = False
Set oCDO = CreateObject("CDO.Message")
With oCDO
With .Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = txtserveur.Text
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = txtport.Text
'----- Dans le cas ou le serveur de mail (comme le mien) demande une authentification
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = txtadresseemail.Text
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = txtmotdepasse.Text
'----- Dans le cas ou le serveur de mail adopte connexion ssl sécurisé
If ChkSSL.Value 1 Then .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") "true"
'----------------
.Update

End With


.From = txtadresseemail
.To = txtemail.Text
.Subject = Text1.Text
.TextBody = Text2.Text
.HTMLBody = "This is a HTML body.
"

Dim ilis
For ilis = 1 To lstFiles.ListItems.Count
.AddAttachment (lstFiles.ListItems.Item(ilis).SubItems(3))
Next
Set Prog = Me.ProgressBar1
Prog.Max = 100
Prog.Refresh
Prog.Value = Prog.Value + 1
.Send

Set oCDO = Nothing

End With
ResultatEnvoi = True
If ResultatEnvoi True Then ProgressBar1.Value 100
'Exit Sub
'err:
'MsgBox err.Description
'Set oCDO = Nothing
End Sub

svp aidez moi
Merci à l'équipe

1 réponse

cs_patosch Messages postés 42 Date d'inscription jeudi 20 septembre 2007 Statut Membre Dernière intervention 26 juin 2013
10 mars 2011 à 13:43
bonjour de cette maniere il est difficile de faire un progress bar car selon les becanes le temps peut varier

d'autant plus que pour incrementer ton progressbar il faudrais capturer le processus de l'email en cours et puis sur quoi se baser
non bien trop aleatoire

au plaisir
0
Rejoignez-nous