Office excel & outlook

Closed
bala1234 Posts 1 Registration date Friday March 8, 2013 Status Member Last seen March 8, 2013 - Mar 8, 2013 at 02:55 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 11, 2013 at 11:05 AM
Hello jim,

"I have a Excel Sheet in which details of member are recorded with there Date of Birth and e-mail id. and I want to wish them on there Birthday by mail. for this every time i have to check the sheet filter them for today's date and then send the mail individually.

This Macro helps you to do this for you. You have to just open your excel sheet and run the macro. "

The code given by you works, but is there any way to send the mails from common mail id, instead of the personel mail id.

Pls help.....
Related:

2 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 9, 2013 at 09:43 AM
Who is "jim" and what macro? what is "common mail id"

try some thing like this
where you have .TO etc, add this line

.SentOnBehalfOfName = "email address here"
0
Actually I am trying to send automated birthday wishes to my team members, we worked wiith a excel macro program, Jim helped me through net, but it helps me to send the birthday message, but From id is my personal id, instead of that I want to use some common mail id. Can you help me on that?

code given as follows,

Sub BD()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Dim lastRow As Long
Dim dateCell As Date

Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
lastRow = Range("D" & Rows.Count).End(xlUp).Row
On Error GoTo cleanup
For Each cell In Range("D2:D" & lastRow)
dateCell = cell.Value
If Day(dateCell) = Day(Date) And Month(dateCell) = Month(Date) Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = cell.Offset(0, 1).Value
.Subject = "Happy Birthday"
' Here put your Message
.Body = "Dear " & Cells(cell.Row, "C").Value _
& vbNewLine & vbNewLine & _
"Many Happy Returns of the Day " _
& vbNewLine & vbNewLine _
& vbNewLine & vbNewLine & _
"Cheers," & vbNewLine & _
"Team"
.send
End With
On Error GoTo 0
Set OutMail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True

End Sub
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 11, 2013 at 11:05 AM
I used google search to find out what message you were talking about. Have you tried the change i suggested
0