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
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 11, 2013 at 11:05 AM
Related:
- Office excel & outlook
- Save as pdf office 2007 - Download - Other
- Microsoft office 2010 free download - Download - Office suites
- Kmspico office - Download - Other
- Microsoft office 2013 free download - Download - Office suites
- Outlook free download - Download - Email
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
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
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Mar 11, 2013 at 11:05 AM
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