Hi
i have the following code:
[CODE]
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim OutApp As Object
Dim Outmail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
On Error GoTo cleanup
For Each cell In Columns("AO").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "AN")) = "yes" _
And LCase(Cells(cell.Row, "AM").Value) <> "send" Then
Set Outmail = OutApp.CreateItem(0)
On Error Resume Next
With Outmail
.To = cell.Value
.cc = Cells(cell.Row, "AP")
.Subject = "Daily Query Reminder"
.Body = "Goodday " & Cells(cell.Row, "AJ").Value _
& vbNewLine & vbNewLine & _
"Please note that an items has been logged on the daily query list " & _
"complete at your soonest convenience." _
& vbNewLine & vbNewLine & _
"Please follow the link supplied and add your comments on the document." _
& vbNewLine & vbNewLine & _
"http://insight.nampak.com/sites/Divfood/OFC/Mobeni%20Paint%20Zero%20OTIF%20RCA/Old%20reports/Daily%20Query%20List%20-%20test2.xlsm"
.Send
End With
On Error GoTo 0
Cells(cell.Row, "AM").Value = "send"
Set Outmail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub
[CODE]
I need to add a VLOOKUP at the TO: using name in column AJ. I have use a =HYPERLINK("mailto :"&VLOOKUP(AJ12,data!A:B,2,FALSE)) formula and it is not sending the mail to the e-mail address.
Bookmarks