Загрузка страницы

Create a Reset Form Button in Word - How to Reset Form Fields in Word Fillable Forms

How to reset form fields in a Word fillable form by adding an ActiveX command button that when a user clicks it, all of the form fields will be cleared out. Create a reset form button in Word that will work to clear both Legacy form fields and Content Control form fields. We will insert a command button on our form and then program the button with the VBA code below. This button will uncheck a checked box, clear text from a text box and reset drop-down lists to the initial value. This Reset Form button will allow users to clear existing data that had been filled into the form so they can quickly and easily re-use the form like new. The Reset button is helpful when saving your form document as a Template file type will not support other features in the form.

Here is the VBA Code we used in our Reset Form button (notice two areas where I indicate you have to replace and insert angled brackets as the YouTube Description doesn't allow those characters):

Private Sub CommandButton1_Click()
Dim cc As ContentControl
Dim ff As field

' Unprotect the document to allow form field entry
If ActiveDocument.ProtectionType [Insert Angled Brackets] wdNoProtection Then
ActiveDocument.Unprotect
End If

' Clear content control form fields
For Each cc In ActiveDocument.ContentControls
Select Case cc.Type
Case wdContentControlText ' Text content control
cc.Range.Text = ""
Case wdContentControlComboBox ' Combo box content control
cc.Range.Text = ""
Case wdContentControlDate ' Date picker content control
cc.Range.Text = "" ' Clear the date value by setting the Range.Text property to an empty string
Case wdContentControlCheckBox ' Checkbox content control
cc.Checked = False ' Uncheck the checkbox
End Select
Next cc

' Reset legacy form fields
ActiveDocument.ResetFormFields

' Protect the document again if needed
If ActiveDocument.ProtectionType = wdNoProtection Then
' Replace "YourPassword" with the actual password if your document is password-protected
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub
Private Sub CommandButton1_Click()
Dim cc As ContentControl
Dim ff As field

' Unprotect the document to allow form field entry
If ActiveDocument.ProtectionType [Insert Angled Brackets] wdNoProtection Then
ActiveDocument.Unprotect
End If

' Clear content control form fields
For Each cc In ActiveDocument.ContentControls
Select Case cc.Type
Case wdContentControlText ' Text content control
cc.Range.Text = ""
Case wdContentControlComboBox ' Combo box content control
cc.Range.Text = ""
Case wdContentControlDate ' Date picker content control
cc.Range.Text = "" ' Clear the date value by setting the Range.Text property to an empty string
Case wdContentControlCheckBox ' Checkbox content control
cc.Checked = False ' Uncheck the checkbox
End Select
Next cc

' Reset legacy form fields
ActiveDocument.ResetFormFields

' Protect the document again if needed
If ActiveDocument.ProtectionType = wdNoProtection Then
' Replace "YourPassword" with the actual password if your document is password-protected
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub

TIMESTAMPS ⏰
00:00 Reset Form Button in Word
00:14 Legacy & Content Control Form Fields
00:26 Prepare Form for Reset Button
01:02 Insert Reset Form Button & VBA Code
02:12 Format Reset Form Button
02:34 Test the Reset Form Button
03:56 Reset Content Control Form Fields

COURSE 🎒
Create Fillable Forms, Surveys & Questionnaires in Microsoft Word like a Pro: https://www.youtube.com/playlist?list=PLb80efKTbWuNzAyHVMYrPOS7itBm5gWVs

WATCH NEXT 📺 Make Fillable Form Reusable in Word: https://youtu.be/gzTu46-Z5h0

CHANNEL LINK 📺
https://www.youtube.com/@SharonSmith
Visit my Channel page on YouTube to see all my videos, playlists, community posts and more!

TEMPLATES 📄
Check out my helpful list of templates available for purchase: https://creatoriq.cc/43c51cv
Thank you for supporting my channel! 🌟

FREE DOWNLOADS ⬇️
✦ Visit https://mailchi.mp/6a0859ea0844/sharonsmithhrformulasdownload to sign-up for my e-mail list and get FREE downloads of super helpful spreadsheet formulas, dashboards and Org Chart templates for HR professionals.

CONNECT WITH ME 📎
Visit my website: https://www.sharonsmithhr.com for more information, tools and resources.
LinkedIn: https://www.linkedin.com/in/sharonsmithhr
Twitter: https://twitter.com/SharonSmithHR
Instagram: https://www.instagram.com/sharonsmithlearning/
Facebook: https://www.facebook.com/SharonSmithLearning

Видео Create a Reset Form Button in Word - How to Reset Form Fields in Word Fillable Forms канала Sharon Smith
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
15 апреля 2024 г. 19:33:32
00:05:49
Другие видео канала
The Value of Your Hidden Paycheck (FREE TEMPLATE)The Value of Your Hidden Paycheck (FREE TEMPLATE)How to Analyze Data Using IF Function in ExcelHow to Analyze Data Using IF Function in ExcelSet a Maximum Character Length in Word Fillable Form - Set Max Character LimitSet a Maximum Character Length in Word Fillable Form - Set Max Character LimitHow to Lock and Protect Cells in Excel (Lock and Unlock cells before you Protect your Spreadsheet)How to Lock and Protect Cells in Excel (Lock and Unlock cells before you Protect your Spreadsheet)Best Job Boards for Tech Jobs 2023 - Top Places to Search for Technology Jobs - Tech Job Board SitesBest Job Boards for Tech Jobs 2023 - Top Places to Search for Technology Jobs - Tech Job Board SitesHow to Match Colors, Adjust Gradient Fill & Add Drop Shadows - Creating Letterhead in Word 2 of 4How to Match Colors, Adjust Gradient Fill & Add Drop Shadows - Creating Letterhead in Word 2 of 4How to Customize the Quick Access Toolbar and Status Bar in Excel (2 Useful Commands)How to Customize the Quick Access Toolbar and Status Bar in Excel (2 Useful Commands)How to Create a Progress Circle Chart in Excel - Dynamically Display Percentage of CompletionHow to Create a Progress Circle Chart in Excel - Dynamically Display Percentage of CompletionHow to Add Graphics in the Header and Footer in Word - Creating Letterhead in Word 3 of 4How to Add Graphics in the Header and Footer in Word - Creating Letterhead in Word 3 of 4How to Extract First Name in Excel (2 Helpful Ways)How to Extract First Name in Excel (2 Helpful Ways)How to Password Protect Excel Spreadsheets (Cybersecurity Tip)How to Password Protect Excel Spreadsheets (Cybersecurity Tip)Add Shortcuts to Ribbon in Excel - Speed Up your Excel Workflow using the Quick Access ToolbarAdd Shortcuts to Ribbon in Excel - Speed Up your Excel Workflow using the Quick Access ToolbarHow to Adjust Margins in Word - Custom Margins -  Create A Letterhead in Word 4 of 4How to Adjust Margins in Word - Custom Margins - Create A Letterhead in Word 4 of 4Export PDF Form Field Data from Adobe Acrobat Pro to Excel - Adobe Acrobat Forms Data CollectionExport PDF Form Field Data from Adobe Acrobat Pro to Excel - Adobe Acrobat Forms Data CollectionMicrosoft Word Tips & Tricks to Save Time - Part 1Microsoft Word Tips & Tricks to Save Time - Part 1Get Candidates to Accept Job Offer Using Hidden Paycheck (FREE Hidden Paycheck Template)Get Candidates to Accept Job Offer Using Hidden Paycheck (FREE Hidden Paycheck Template)Combine Data From Multiple Cells into One Cell (Create ID Number in Excel)Combine Data From Multiple Cells into One Cell (Create ID Number in Excel)How to Change Cell Color In Excel Based on Value (Conditional Formatting in Excel)How to Change Cell Color In Excel Based on Value (Conditional Formatting in Excel)Top PowerPoint Tips for Work or SchoolTop PowerPoint Tips for Work or SchoolResume Writing Tip - Creating A Master Resume | Winning Resume Tips for Jobseekers | #ShortsResume Writing Tip - Creating A Master Resume | Winning Resume Tips for Jobseekers | #ShortsHow to Create Sheet Tabs from a List - Then Make a Table of Contents with LinksHow to Create Sheet Tabs from a List - Then Make a Table of Contents with Links
Яндекс.Метрика