godzilla185
New Member
- Joined
- Sep 27, 2021
- Messages
- 18
- Office Version
- 365
- Platform
- Windows
HI, I have seen threads on creating multiple different emails based on different data in my excel, but I am looking for a slightly diff (and hopefully easier) alternative.
I have the following code which opens up an email and prepopulates it for me without referencing any excel data or cells:
Sub allemailsin1()
'open outlook ready to send email
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
todays_date = Date$
With OutMail
.Display
End With
Signature = OutMail.body
With OutMail
.To = "person1"
.CC = "myself@gmail.com"
.BCC = ""
.Subject = "test 1 " & " " & Date$
.body = " HI," & vbNewLine & vbNewLine & "Hope you had a great day" & vbNewLine & vbNewLine & Signature
.Display
End With
End Sub
I just want to somehow loop this so that it can do what it does but x3/4 times and open NEW emails and populate them with To = "person2"... "person3" ... The reason is I have certain emails I have to repeat every single day and this would prepare the templates for me in the easiest way without having to worry about excel data or sheets.
Is anyone able to help me with this? I appreciate your time.
I have the following code which opens up an email and prepopulates it for me without referencing any excel data or cells:
Sub allemailsin1()
'open outlook ready to send email
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
todays_date = Date$
With OutMail
.Display
End With
Signature = OutMail.body
With OutMail
.To = "person1"
.CC = "myself@gmail.com"
.BCC = ""
.Subject = "test 1 " & " " & Date$
.body = " HI," & vbNewLine & vbNewLine & "Hope you had a great day" & vbNewLine & vbNewLine & Signature
.Display
End With
End Sub
I just want to somehow loop this so that it can do what it does but x3/4 times and open NEW emails and populate them with To = "person2"... "person3" ... The reason is I have certain emails I have to repeat every single day and this would prepare the templates for me in the easiest way without having to worry about excel data or sheets.
Is anyone able to help me with this? I appreciate your time.