View Single Post
 
Old 05-16-2024, 02:43 PM
guyver4 guyver4 is offline Windows 11 Office 2016
Novice
 
Join Date: May 2024
Posts: 2
guyver4 is on a distinguished road
Default vba Send Word document as email, not attachment

Hello everyone. I am wondering if I can get some help with this code I am using below.

While it currently sends the complete document text to Outlook as a Doc attachement,
I would like it to actually send the document contents to the body of the email.


Thanks.

Sub eMailActiveDocument()

Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document

Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
Doc.Content.Copy

With EmailItem
.Subject = "Insert Subject Here"
.Body = "Insert message here" & vbCrLf & _
"Line 2" & vbCrLf & _
"Line 3"
.To = "User@Domain.Com"
.Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.FullName
.Send
End With

Application.ScreenUpdating = True

Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing

End Sub
Reply With Quote