Office excel & outlook
Closed
bala1234
rizvisa1
- Posts
- 1
- Registration date
- Friday March 8, 2013
- Status
- Member
- Last seen
- March 8, 2013
rizvisa1
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Related:
- Office excel & outlook
- Set out of office in outlook app - Guide
- Reset office 365 outlook to default settings - Guide
- Office 365 outlook disable hardware acceleration - Guide
- Ms office excel 2010 free download full version with product key - Download
- Microsoft office excel viewer 2013 free download - Download
2 replies
rizvisa1
Mar 9, 2013 at 09:43 AM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
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"
try some thing like this
where you have .TO etc, add this line
.SentOnBehalfOfName = "email address here"
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
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
rizvisa1
Mar 11, 2013 at 11:05 AM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
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