HeyItsDizzy
New Member
- Joined
- Apr 11, 2018
- Messages
- 20
Hey guys I have a list of many clients and I want to send a nice email that looks like I have typed each email individually,
my biggest issues are that I lose my email signature when I enter anything into the body text, and the other thing is I can't get all the information from my "Sheet3" to show up in the email body, no 'cells()' or 'range()' statements I've Tried are working for me, the only information I can get is only from 'Sheet 3 - Cell A1'. Then if I put all the lines that I want to feed in, into cell A1, I then lost the visual formatting (text size and colour) that makes the email look nicer.
in the attached document my "Sheet3" looks exactly how I want it to look in the email can we keep this source formatting?
the below VBA code works for simple application but I feel like it is too simple for what I need. I cant for the life of me find the information I am after (I have left a few comments in the code for my own reference hopefully it helps you guys too)
document: https://drive.google.com/file/d/10jFu5H9QHEn9tbO_5Ldenn9mVrzP0BwY/view?usp=sharing
my biggest issues are that I lose my email signature when I enter anything into the body text, and the other thing is I can't get all the information from my "Sheet3" to show up in the email body, no 'cells()' or 'range()' statements I've Tried are working for me, the only information I can get is only from 'Sheet 3 - Cell A1'. Then if I put all the lines that I want to feed in, into cell A1, I then lost the visual formatting (text size and colour) that makes the email look nicer.
in the attached document my "Sheet3" looks exactly how I want it to look in the email can we keep this source formatting?
the below VBA code works for simple application but I feel like it is too simple for what I need. I cant for the life of me find the information I am after (I have left a few comments in the code for my own reference hopefully it helps you guys too)
document: https://drive.google.com/file/d/10jFu5H9QHEn9tbO_5Ldenn9mVrzP0BwY/view?usp=sharing
Code:
Sub SendPersonalisedEmail()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Dim intHowManyRows As Integer
With Application
.ScreenUpdating = False
End With
intHowManyRows = Application.Range("A2:Q1000").CurrentRegion.Rows.Count ' <- this range doesnt seem to work, why?
For r = 1 To intHowManyRows
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Cells(r, 5).Value 'replace with your company name
.Subject = "G'day " & Cells(r, 2).Value & " From [my company name] "
.CC = Cells(r, 12).Value
'.Attachments.Add ("") ' -> If you want to add attachments
'.Attachments.Add ("") ' -> If you want to add attachments
'.Attachments.Add ("") ' -> If you want to add attachments
'replace the text on next line within the 2 double quotation marks and input anything you want, then remove the apostrophy before the & symbol
.Body = "Hi " & Cells(r, 9) & vbNewLine & vbNewLine & Cells(r, 16) & vbNewLine & Cells(r, 17) & vbNewLine & ThisWorkbook.Sheets("Sheet3").Range("A1")
.Display 'Or use Send
End With
Next r
Set OutMail = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub