Use IF Logic and Conditional Formatting in Microsoft Word Forms
Question details
Configure a restricted-editing Word form so dropdown choices control other fields, paragraph visibility, and list formatting.
- Product
- Microsoft Word for Microsoft 365
- Device & OS
- not provided
- Scenario
- A form author wants dropdown selections to determine which content and formatting users see.
- Observed behavior
- Dropdown choices should trigger conditional updates to other form controls, paragraphs, and lists.
Open the form in desktop Word and enable the Developer tab through File > Options > Customize Ribbon if it is hidden. Identify the dropdown choices and content that each choice should affect, and check whether you can remove the form's editing restriction while configuring it.
Use content controls and VBA to respond to dropdown selections
Use a content control exit event to apply conditional changes when a user leaves a dropdown.
Word does not provide Excel-style conditional formatting for form fields. A VBA event can inspect a dropdown value and update other content controls or formatting.
The example below hides or shows a tagged content control in a form protected without a password. It does not update other dropdowns or list formatting; add separate conditions and actions for those requirements.
On the Developer tab, insert a Drop-Down List Content Control. Open Developer > Properties, set its Tag to Visibility, and add the choices Show and Hide.
Select the paragraph or text to control and insert a Rich Text Content Control from Developer. Open its Properties and set its Tag to ConditionalText.
Press Alt+F11, open ThisDocument for the form in the VBA editor, and paste this code: Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Dim target As ContentControl Dim protection As WdProtectionType Dim hideContent As Boolean If ContentControl.Tag <> "Visibility" Then Exit Sub Select Case Trim$(ContentControl.Range.Text) Case "Show": hideContent = False Case "Hide": hideContent = True Case Else: Exit Sub End Select protection = Me.ProtectionType On Error GoTo Failed If protection <> wdNoProtection Then Me.Unprotect For Each target In Me.SelectContentControlsByTag("ConditionalText") target.Range.Font.Hidden = hideContent Next target If protection <> wdNoProtection Then Me.Protect Type:=protection, NoReset:=True Exit Sub Failed: On Error Resume Next If protection <> wdNoProtection And Me.ProtectionType = wdNoProtection Then Me.Protect Type:=protection, NoReset:=True End If On Error GoTo 0 MsgBox "The form could not be updated. Check its protection and control tags." End Sub
Save the document as a Word Macro-Enabled Document (.docm). In Developer > Restrict Editing, apply the desired restriction without a password for this example. Enable macros if prompted, choose Show or Hide, and move focus out of the dropdown to run the event.
Return to ThisDocument in the VBA editor and add Select Case branches for your actual choices. Use the tagged controls' ranges to update other fields or apply the required list formatting, then test every choice under the intended restriction.

Use a VBA UserForm for more complex form logic
Use a custom dialog when several selections need to control one another before values are written to the document.
Edit Word Documents with WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for opening and editing documents. Its Microsoft Word format compatibility makes it easier to move existing files, though it does not fix Word's VBA or restricted-editing behavior.

Frequently Asked Questions
Can a Word dropdown automatically hide a paragraph without VBA?
A standard content control does not provide an Excel-style conditional formatting rule. For automatic changes in a form, use a VBA event or another form-building approach.
When does the content control exit event run?
Document_ContentControlOnExit runs when the user leaves a content control. Put the event procedure in the document's ThisDocument module and test by moving focus out of the dropdown.
Why does the form not respond to my dropdown selection?
Check that the file is saved as .docm, macros are enabled, the procedure is in ThisDocument, and the control tags and dropdown values match the code. Editing protection can also prevent changes unless the code handles it.
Can VBA change bullets or numbering based on a selection?
Yes. In the dropdown's event procedure, use If or Select Case to select the appropriate action, then apply list formatting to the relevant paragraph range. Test the result with the form's editing restriction enabled.
Does hiding text prevent users from seeing it?
No. Hidden text is a formatting setting, not a security measure. Users may display it through Word's formatting-mark settings, and it may print if hidden-text printing is enabled.




