![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi everyone,
How do you add a line from a fillable word document into a VBA that you are using to email out that said document? I have a VBA but I want to enter the name of the person completing the form from a line in the form into the body text of the email. (if that makes sense) my VBA is: Private Sub CommandButton1_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 = "Referral" Dim sMsgBody As String sMsgBody = sMsgBody & "Dear Team" & vbCr & vbCr sMsgBody = sMsgBody & "Please find attached my completed referral form for a woman to your services" & vbCr & vbCr sMsgBody = sMsgBody & "Kind Regards," & vbCr .body = sMsgBody .To = "person@person.com" .Importance = 1 .Attachments.Add Doc.FullName .Send End With Application.ScreenUpdating = True Set Doc = Nothing Set OL = Nothing Set EmailItem = Nothing End Sub |
| Tags |
| vba word outlook email |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to make a fillable word template but not see what is not req'd to be filled in saved as document | sjohnstone@edgeautomation | Word | 1 | 05-02-2017 10:05 AM |
Protect fillable word 2013 document
|
metsmaniac | Word | 1 | 06-30-2016 12:35 PM |
Word 2010 - How to create a fillable document from a boilerplate document
|
sheaters | Word | 2 | 05-04-2016 01:57 PM |
How to make uneditable but fillable document in word 2003?
|
officeboy09 | Word | 1 | 01-22-2014 03:54 PM |
Put a document in word into a fillable form
|
groovy chick | Word | 3 | 01-18-2012 04:49 AM |