Send email from Excel using Outlook template



Send email from Excel using Outlook template. Send personalized, emails with individual attachments using an Outlook Template. Check out my online courses www.easyexcelanswers.com/courses.html
All my courses include online support and a user manual
Let me teach you the VBA that I have learn in my five years of consulting

Let’s take the frustration out of user forms

Become an Affiliate and earn 25% on Course Sales

For more help visit my website www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.

Contact me regarding customizing this template for your needs.

Click for online Excel Consulting

I am able to provide online help on your computer at a reasonable rate.

I use a Blue condenser Microphone to record my videos, here is the link

Check out Crowdcast for creating your webinars

If you need to buy Office 2019 follow

I use Tube Buddy to help promote my videos
Check them out

Follow me on Facebook

TWEET THIS VIDEO

Follow me on twitter
easyexcelanswers

IG @barbhendersonconsulting

You can help and generate a translation to you own language

*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.

code
Sub Send_email_fromtemplate()
Dim edress As String
Dim subj, name As String
Dim filename As String
Dim outlookapp As Object
Dim outlookmailitem As Object
Dim myAttachments As Object
Dim path As String
Dim attachment As String
Dim r As Long
Dim olInsp As Object
Dim wdDoc As Object
Dim oRng As Object
Dim customername As String

r = 2

Do While Sheet1.Cells(r, 1) not equal to “”
Set outlookapp = CreateObject(“Outlook.Application”)
‘call your template
Set outlookmailitem = outlookapp.CreateItemFromTemplate(“C:UsersscreaOneDriveDesktopinvoicesdemotemplate.oft”)
outlookmailitem.Display
Set myAttachments = outlookmailitem.Attachments
‘deifine your path for the attachment
path = “C:UsersscreaOneDriveDesktopinvoices”
edress = Sheet1.Cells(r, 1)
name = Sheet1.Cells(r, 2).Value
subj = Sheet1.Cells(r, 3)
filename = Sheet1.Cells(r, 4)
attachment = path + filename
With outlookmailitem
.To = edress
.cc = “”
.bcc = “”
.Subject = subj
myAttachments.Add (attachment)
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Range
With oRng.Find
Do While .Execute(FindText:=”{{Placeholder for Name}}”)
oRng.Text = name
Exit Do
Loop
End With
Set xInspect = outlookmailitem.GetInspector

.Display
‘.send
End With
‘clear your email address
edress = “”
r = r + 1
Loop
‘clear your fields
Set outlookapp = Nothing
Set outlookmailitem = Nothing
Set wdDoc = Nothing
Set oRng = Nothing
End Sub

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
2 Comments
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
Robert Redford

You rock Barb. Thanks for that. I use your old code to email from Excel. This is a nice new touch.

Muhammad Rizwan

Hi Miss @Barb Henderson, I have sent you an email regarding an excel issue on gmail. Kindly check it.