Sub Email()
' move this to "ThisWorkbook" open action
Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(olMailItem)
fName = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
Var = "file:\\V:\shared_diamond\Unique\CheckRc\2010DailyDeposits.xls"
With otlNewMail
.To = "adam.arends@xxxxxx.com"
.Subject = "Revised Cash Report"
.Body = "The deposit spread sheet has been updated for today's deposits. you can find it here:" + Var & Chr(13) & Chr(13) & "Thanks," & Chr(13)
.send
End With
Set otlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
lngR = MsgBox("Message sent to A/R")
End Sub
I have the above code created to send an email at the click of a button. However, the person doing the processing changes from time to time and i would like to send it to just that person. i had thought about using a cell indicator ("X" next to their name in some random cell at the header area). Can that kind of thing be coded in ".To = ... line?
Thanks
Bookmarks