How to Manage Form Controls and Macros in a Word Template
Question details
The user needs to set up a macro-enabled Word template to retrieve field values, control printing, hide buttons, and manage the interface using form controls and macros.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Creating and managing a macro-enabled document template that contains form fields, buttons, and interface customization requirements.
- Observed behavior
- The user is looking for the best method to retrieve legacy field values and properly manage interface elements like buttons and the Ribbon upon opening the form.
Ensure your document is saved as a Macro-Enabled Template (.dotm) and that the Developer tab is enabled in your Ribbon so you can access form controls and VBA tools.
Optimize Form Controls and Avoid ActiveX
For better compatibility and stability, avoid legacy ActiveX controls and standardize your form fields using either Content Controls or legacy form fields exclusively.
ActiveX controls are considered legacy technology and can cause compatibility and security issues in modern word processing applications.
It is highly recommended to transition to Content Controls. Avoid mixing Content Controls and legacy fields within the same document to prevent unexpected behavior during data retrieval or printing.
Navigate to the Ribbon and click on the Developer tab to access the Controls group.
Select the desired area in your template and click on 'Rich Text', 'Plain Text', or 'Date Picker' content controls instead of relying on ActiveX alternatives.
Click 'Restrict Editing' in the Developer tab, check 'Allow only this type of editing in the document', and select 'Filling in forms' from the dropdown to protect your layout.

Manage Macro Execution via the Quick Access Toolbar
Instead of embedding ActiveX command buttons directly into the document for macros, assign your macros to the Quick Access Toolbar (QAT).
Manage Macros and Forms Efficiently with WPS Writer
WPS Writer provides robust support for macro-enabled templates (.dotm), legacy form fields, and VBA scripts, allowing you to streamline data entry without interface clutter.
- 1. Enable Developer Tools: Go to Menu > Options > Customize Ribbon and check the Developer tab to make it visible.
- 2. Insert Form Fields: Under the Developer tab, use the 'Forms' group to insert text fields, checkboxes, or drop-down lists into your document.
- 3. Run Macros Safely: Click 'Macros' in the Developer tab to view, edit, or execute your custom VBA scripts to retrieve field values seamlessly.

Frequently Asked Questions
Why should I avoid ActiveX controls in my Word template?
ActiveX is a legacy technology that is often disabled by default due to security vulnerabilities. It can also cause interface freezing, scaling issues, and formatting errors in modern word processors.
How do I hide the Ribbon when the form opens?
You can manually hide the Ribbon by double-clicking any of the Ribbon tabs to collapse it. For automation, you can use a VBA AutoOpen macro calling the CommandBars framework to minimize the Ribbon upon opening the template.
Can I retrieve data from Content Controls using VBA?
Yes, you can use the Document.SelectContentControlsByTitle or ByTag methods in your VBA script to easily locate, retrieve, and manipulate the values entered by users in Content Controls.




