Insert Plain-Text Content Controls in Microsoft Word Macros
Question details
Add editable plain-text controls to sentences inserted by Word macros or reusable boilerplate.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- The user creates custom macros to insert recurring text and needs editable fields within that text.
- Observed behavior
- Reusable sentences contain plain-text content controls that can be edited after insertion.
Open the document in the desktop version of Word and decide where the editable field should appear. To create a macro, make sure the Developer tab is available and macros are permitted by your organization's settings.
Insert a plain-text content control with VBA
Use this approach when an existing macro needs to add an editable field at the current selection.
In Word, select Developer > Visual Basic, then open the module containing your macro or choose Insert > Module.
In your macro, add this statement at the point where the control should appear: ActiveDocument.ContentControls.Add wdContentControlText, Selection.Range
Return to the document, place the cursor at the desired insertion point, and select Developer > Macros. Choose your macro and select Run.
Click the inserted content control and type plain text. If the control belongs inside a longer sentence, have your macro insert the surrounding text and position the selection before adding the control.

Save boilerplate with content controls as AutoText
Use AutoText when you want to insert the same sentence and editable fields without running a custom macro.
Create reusable documents with WPS Writer
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Word format compatibility for easier migration. Use WPS Writer for everyday document editing; it does not fix Word VBA macros.

Frequently Asked Questions
What VBA statement inserts a plain-text content control?
Use ActiveDocument.ContentControls.Add wdContentControlText, Selection.Range in a Word VBA macro. It adds the control at the current selection.
Can AutoText save a sentence with content controls?
Yes. Select the sentence and its controls, then choose Insert > Quick Parts > AutoText > Save Selection to AutoText Gallery. Insert it later from the AutoText gallery.
How can I insert an AutoText entry without opening the gallery?
In supported desktop versions of Word, type the entry's name at the insertion point and press F3.
How do I keep a macro in my Word document?
Choose File > Save As and save the document as a Word Macro-Enabled Document (.docm). Macro availability may also depend on your security settings.




