Creating a Fillable Form with a Command Button using MS Word || #fillableforms #MSWord #ITCSEC #ITtutorial
Once you have created your Fillable Form you would want to make it easy for your users to send their completed forms back to you. This can be done using a command button. When the user clicks the button, it will automatically open their MS Outlook email client and have an e-mail with your return email address, subject and body text with the completed form attached, so that all they have to do is click “Send.”
Timestamp
0:00 Intro to creating a fillable form with MS Word
0:15 Adding Developer Tab to our Ribbon
1:10 Building our Fillable Form
11:28 Saving the Fillable Form
12:12 Adding VBA code to the command button
13:51 Restrict editing on Fillable Form
14:40 Testing the Fillable Form
17:00 End
----------------------------------------------------------------------------------------------------------------------------------------------------
Here is the VBA code used in this video to create the macro for the Submit command button (be sure to replace the Subject, Body Text and Email address with your own information):
Private Sub CommandButton1_Click()
Dim xOutlookObj As Object
Dim xEmail As Object
Dim xDoc As Document
Application.ScreenUpdating = False
Set xOutlookObj = CreateObject("Outlook.Application")
Set xEmail = xOutlookObj.CreateItem(olMailItem)
Set xDoc = ActiveDocument
xDoc.Save
With xEmail
.Subject = "Subject of the email goes here"
.Body = "Body of the email goes here"
.To = "[email protected]"
.Importance = olImportanceNormal
.Attachments.Add xDoc.FullName
.Display
End With
Set xDoc = Nothing
Set xEmail = Nothing
Set xOutlookObj = Nothing
Application.ScreenUpdating = True
End Sub