- Combines content and ActiveX controls for guided and flexible input.
- Validate data with events (GotFocus, LostFocus, KeyPress) and VBA examples.
- Avoid conflicts by grouping radio buttons with different GroupNames.
- Protect the document with “Filling in forms” to preserve the design.
Creating forms that are not only fillable but also guide the user, validate data and keep the design intact is perfectly possible in Word. With a combination of Content controls and ActiveX, well-defined properties, events and selective protection, you can build really useful forms for office, administration and documentation, and in complementary cases you can see how to create smart forms in Excel.
In the next lines you will see how to activate the necessary tools, what type of controls to use in each case, how validate inputs with events (for example, numbers or dates), how to group options so they don't interfere with each other, and how to protect the document so only the fields are filled in. All with a practical approach, explained step by step and with some VBA snippets that will save you time.
Preparations: Developer tab, design mode and layers
Before you start, make sure the Developer tab is visible: go to File > Options > Customize Ribbon and check the Developer box; confirm with OK. This step is key because from there you will access the controls and their properties.
Word allows you to insert controls on two different layers: the text layer (inline) and the drawing layer (floating). If you insert them from the Control Toolbar normally, the control goes to the drawing layer; if you hold down the Shift key while clicking the control, you insert it inline with the text. This difference matters because inline controls behave like floating controls. InlineShapes and those in the drawing layer like Shapes, which affects their positioning and how they are accessed by code.
A display detail: ActiveX controls left on the drawing layer are only visible in Print Layout view or Web Layout view. If you don't see them, change the view. Also, turn on the Design mode in Developer when you want to insert or configure controls, and deactivate it to test their actual behavior.

Choosing controls well: content vs. ActiveX
Word offers two large families of controls. On the one hand, there are the content controls (modern) controls like Rich Text, Plain Text, Date Picker, or Drop-Down List. On the other hand, legacy/ActiveX controls like Radio Buttons or other more advanced inputs. Combining the two gives you flexibility: modern content for text and date fields, and ActiveX for richer behaviors.
For texts like First Name, Last Name, Age, or Phone, use Plain Text if you want entries on a single line, or Rich Text when you need to allow multiple lines or format. For the date, the Date Picker type content control is perfect and you can adjust the format from its Properties.
If you need the user to choose from predefined items (e.g., Gender), the Content Dropdown List is straightforward to configure: open its Properties and add the entries you need. drop down lists you can maintain control of what is filled and avoid unexpected values.
When you need exclusive selection options (only one at a time), use Option Buttons (ActiveX). For multiple, independent selections, use Check Boxes. These are inserted from Legacy Tools > ActiveX Controls, and then you can adjust its properties and the text displayed next to it.
A lesser known but super useful tool is the building block control. It allows the user to choose between predefined text blocks (e.g., alternative clauses). Insert it from the Developer tab, place the cursor where you want, and select the Building Block Gallery Content Control; you can later configure its properties to suit your needs.
Practical example: form with personal data and sections
A clear way to organize a form is to use a table with two columns: on the left the label (Name, Date, etc.) and on the right the control. It is not mandatory, but it helps to align and maintain the clean design.
Date: Inserts a date content control. The initial "click to enter a date" help text can be edited for clarity. From Properties, you can choose the display format (e.g., dd/MM/yyyy) to display the data correctly. homogeneous throughout the document.
First Name, Last Name, Age, and Phone Number: For these fields, Plain Text is usually sufficient. Choose Rich Text if you anticipate line breaks or want to allow formatting. The important thing is to choose a type that fits the expected behavior of the field.
Gender: Use a Content Dropdown List. Go to its Properties and add each option (e.g., Female and Male). This avoids confusion and reduces typing errors. improving quality of the data.
Blood type: For mutually exclusive options, insert Radio Buttons (ActiveX) from Legacy Tools > ActiveX Controls > Radio Button. Change the displayed text using Radio Button Object > Modify. Add as many as you need (A+, A-, B+, B-, AB+, AB-, 0+, 0-), keeping the consistency on the labeling.
Desired hobbies or services: If you want to allow marking several, insert Casillas (ActiveX). This allows the user to select multiple elements without conflict. You can edit their text just like you would with radio buttons.
Allergies: It's common to ask a Yes/No question here using radio buttons. Important: If the Allergy buttons are disabled when you select a blood type, it's because Word is interpreting that they all belong to the same logical group. Solution: Assign a GroupName different. Select each Allergies radio button, go to Properties, and set GroupName = Allergies to behave as a separate group.
Allergy Details or Observations: Add a content check Rich text to allow for free-form descriptions on multiple lines. This is extremely convenient for contextual comments or user annotations.
Key Properties and Behavior of ActiveX
In Word documents, ActiveX controls have events that you can take advantage of. Word natively implements GotFocus y LostFocus, and the rest of the events specific to each control behave as in Microsoft FormsThis opens the door to validating fields as the user enters or exits them.
An important nuance for programming: within the event code of a control embedded in the document, the keyword Me refers to the document, not the control. Therefore, if you want to act on the control, you can use its name directly or navigate through the objects in the document.
Also, remember the code access distinction: controls on the text layer are exposed as InlineShapes, while those on the drawing layer are called Shapes. Choosing one layer or another influences how you iterate and position controls programmatically.
When you don't want the user to change the document layout but still want them to interact with the controls, it's best to apply edit protection. In older versions, there was a Protect Form button on the Forms bar; in current versions, the flow is Review > restrict editing, something we will see in detail later.
Data Validation: Practical Patterns in VBA
Validation gives your form "intelligence." You can avoid letters in the Age field, prevent phone numbers with too many characters, force a correct date format, etc. The key is to hook the right events from the ActiveX controls (and, if applicable, content macros).
Increments controlled with a SpinButton: If you want the Age or a quantity to increase/decrease by one, add a SpinButton (ActiveX) and an associated TextBox. The following very simple example, updates TextBox1 when the control is clicked:
Private Sub SpinButton1_SpinDown()
Me.TextBox1.Value = Me.TextBox1.Value - 1
End Sub
Private Sub SpinButton1_SpinUp()
Me.TextBox1.Value = Me.TextBox1.Value + 1
End Sub
View Change (useful when debugging): A button can switch to Print view and set the zoom, to review the final output of the form. This Click procedure runs when pressed and adjusts the zoom. active window:
Private Sub cmdChangeView_Click()
With Me.ActiveWindow.View
.Type = wdPrintView
.Zoom.Percentage = 100
End With
End Sub
Real-time number validation (Age): In the KeyPress/Change event of the Age TextBox, filter out any non-digit characters. This way, you avoid incorrect entries from the start. very effective when it fills quickly.
' En un TextBox ActiveX (por ejemplo, TextBoxEdad)
Private Sub TextBoxEdad_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If Not (KeyAscii >= 48 And KeyAscii <= 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Date validation on field output: If you're using an ActiveX TextBox for date (or mapping the date control's value), check with IsDate in the LostFocus event. If it fails, mark the field in red, display a warning, and return focus so the user can correct the error. value.
Private Sub TextBoxFecha_LostFocus()
If Not IsDate(TextBoxFecha.Text) Then
TextBoxFecha.BackColor = vbRed
MsgBox "La fecha no es válida. Usa el selector o formato dd/mm/aaaa.", vbExclamation
TextBoxFecha.SetFocus
Else
TextBoxFecha.BackColor = vbWhite
End If
End Sub
Fixed-length phone number: You can check the length when leaving the field and allow only digits. If you need hyphens or spaces, you can automatically insert them in the Change event, generating an entry. uniform.
Private Sub TextBoxTelefono_LostFocus()
Dim s As String
s = Trim(TextBoxTelefono.Text)
' Elimina caracteres no numéricos
Dim i As Long, limpio As String
For i = 1 To Len(s)
If Mid$(s, i, 1) >= "0" And Mid$(s, i, 1) <= "9" Then
limpio = limpio & Mid$(s, i, 1)
End If
Next i
If Len(limpio) < 9 Then
MsgBox "El teléfono debe tener al menos 9 cifras.", vbInformation
TextBoxTelefono.SetFocus
Else
TextBoxTelefono.Text = limpio
End If
End Sub
Controlled Lists: With the Content Drop-down List, add options from Properties to prevent fabricated values. In ActiveX (ComboBox), you can also load items by code in Document_Open to centralize the data source.
Private Sub Document_Open()
With Me.ComboBoxSexo
.Clear
.AddItem "Femenino"
.AddItem "Masculino"
End With
End Sub
Unobtrusive alerts: Not everything has to be a MsgBox. Changing the background color, displaying a warning asterisk near the box, or disabling send/print buttons until the fields are correct are less intrusive and more elegant.
How to protect the form to prevent design changes
Once you've defined and tested the controls, apply restrictions so the user can fill out but not alter the document. Go to Review > restrict editingIn the side panel, select "Editing Restrictions" and choose "Form Filling" from the list. Then, click "Yes, apply protection" and, if appropriate, set a password.
With protection enabled, the user will be able to interact with controls (check boxes, choose from lists, type in fields), but will not be able to move tables or edit fixed text. This is ideal when you share forms with clients or other departments and want to preserve the format corporate, or host them in OneDrive.
If you need to edit the design again, use "Suspend Protection" and enter the password. Be sure to save a copy without a password in a secure environment in case you need to revert changes or re-use the document as a template.
Building Blocks: Reusable and Controlled Text
Many forms have texts that change depending on the case (e.g., alternative clauses). The control of building block allows you to offer the user a gallery of predefined texts. Insert the control from the Developer menu, place it in the appropriate position, and then configure its Properties to point to the corresponding gallery.
A common flow is to prepare multiple versions of the text as rich text content controls and use the building block as a "container" to choose which one to insert. It's an organized way to manage content. repetitive without having to manually copy/paste.
Tips for use, compatibility and maintenance
Name your controls clearly (e.g., TextBoxAge, ComboBoxGender). This makes your code easier to read and prevents collisions when writing validations. The more obvious the name, the faster you'll be able to mantener the formula.
If you use ActiveX, remember that they depend on macro security settings. On computers with restrictive policies, you may need to adjust the Trust Center or digitally sign the document. This is important when distributing forms in environments events.
Always test with Design Mode enabled when configuring and disable it to see the actual behavior. Switch to Print Layout view if you don't see controls on the drawing layer; it's a quick check that avoids confusion and saves you time. tiempo.
For more advanced development, keep in mind the difference between InlineShapes and Shapes when accessing them through code, as well as the geometry of tables and margins. A small adjustment to the anchor or the text wrap can completely change the visual outcome, and also consider how to integrate flows with Microsoft Power Automate for repetitive work.
If you need additional documentation on specific control events (e.g., Change, Click, Enter, Exit), the Microsoft Forms reference complements the Word guide very well. Additionally, Word correctly implements GotFocus y LostFocus in documents, allowing you to design validations and contextual help when entering or leaving the field.
For end users, add short instructions next to fields (using placeholder text in content controls). A form with clear guidelines and unobtrusive validations reduces errors and makes the process easier. filled in be faster.
When you share forms on PDF, remember that ActiveX interactivity is lost. If the destination is a fillable PDF, consider creating the fields directly in the PDF with programs to create editable PDF forms or keep the flow in Word to take advantage of the events and the validation logic.
You can build forms in Word that go far beyond a simple document: guided entries, correctly grouped options, clean data from the first try and a design that stays under control thanks to the protección selective editing.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.

