William Mimms
asked on
VBA in Word to send out body of Word doc in Outlook
I have created a document in Word with a "Submit" button that uses VBA to send the document via Outlook as an attachment. My preference would be to send the information included in the Word document in the body of the email message vs. an attachment.
Cut and Paste from developer in Word:
Cut and Paste from developer in Word:
Private Sub Submit_Click()
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
With EmailItem
.Subject = "Quote Request"
.To = "wmimms@metalworkinggroup.com"
.CC = "wnmimms@gmail.com"
.Importance = olImportanceNormal
.Attachments.Add Doc.FullName
.Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Welcome, glad that was useful.
»bp
»bp
ASKER