Re : Mailing global: prendre adresses colonne
Hello,
Ci joint, j'ai adapté un code trouvé sur le forum;
ça fonctionne mais en envoyant un mail séparé à chacun;
comment peux t'on modifier pour un seul mail!
#Public Sub Mailingglobalacheteurs()
Dim OLApplication As Outlook.Application, OLMail As Outlook.MailItem
Dim sigstring As String
Dim signature As String
Dim cell As Range
Application.ScreenUpdating = False
sigstring = "C:\documents and settings\" & Environ("username") & "\application data\microsoft\signatures\signature.txt"
For Each cell In Sheets("bdd acheteurs").Range("H4:H65536").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" Then
cell.Value = cell.Value & ";" & ActiveCell.Offset(, 5).Value
Set OLApplication = CreateObject("Outlook.Application")
Set OLMail = OLApplication.CreateItem(OLMailItem)
On Error Resume Next
With OLMail
signature = sigstring
.To = cell.Value '<-- Ici je veux coller la liste des destinataires se trouvant en colonne A à partir de la cellule A2 en copie cachée
.Importance = olImportanceNormal
.Subject = "Proposition de Biens immobiliers" 'Objet
.Body = ""
.Categories = "Daily"
.OriginatorDeliveryReportRequested = True 'Accusé de dépôt
.Display '<-- Pour vérifier le mail avant l'envoi
End With
On Error GoTo 0
Set OLApplication = Nothing
Set OLMail = Nothing
End If
Next cell
Application.ScreenUpdating = True
End Sub#
Ci joint, lien forum:
https://www.excel-downloads.com/threads/envoi-mail-a-2000-destinataires.92902/
lien fichier test:
Cijoint.fr - Service gratuit de dépôt de fichiers
Bonne journée,
merci