merhaba
bir excelim var ve belli hücrelerde mail adresleri var.
bu mail adreslerine excelldeki belli hücre aralığını alarak mail gövdesine yapıştırıp mail oluşturmasını istiyorum.
ama nedense mail adreslerini hücreden alarak mail yollayamyı beceremedim
kod aşağıda nasıl bir düzenleme yapmalıyım
çalıştırdığımda koddaki bu HTMLBody = RangetoHTML(rng) bunu sarıya boyuyor
[code][/code]
Sub Belirlenen_Hucre_Araligini_Mesaj_Gövdesine_Gonder()
'Office 2000-2010 sürümlerinde çalışır
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set rng = Nothing
On Error Resume Next
Set rng = Sheets("detay").Range("A1:c19").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
Exit Sub
End If
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Cells(7, 1)
.CC = Cells(7, 2)
.BCC = ""
.Subject = ""
.HTMLBody = RangetoHTML(rng)
.Display 'göndermek için .Send
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub