How to Write Checkbox Text to a Document Bookmark in Word Using VBA
Question details
The user needs a Word 2016 VBA UserForm with three single-select checkboxes to write specific text into corresponding document bookmarks when the form button is clicked.

- Product
- Microsoft Word 2016
- Device & OS
- not provided
- Scenario
- A user is building a Word 2016 UserForm with three checkboxes where only one can be selected, and wants the selected checkbox to insert preset text into an associated bookmark when the form is submitted.
- Observed behavior
- The UserForm does not yet insert the selected checkbox text into the intended bookmark because the bookmark-writing code must be placed in the closing button procedure.
Press Alt+F11 in Word to open the VBA editor, display the UserForm, and note the exact names of the three checkboxes and their target bookmarks. Be aware that replacing a bookmark's Range.Text removes the bookmark, so recreate any bookmark that must be reused.
Insert Checkbox Text into a Bookmark from the UserForm Button Click
Use this when the UserForm has only one checkbox selected at a time and you want the close or submit button to write the corresponding text into the correct bookmark.
Place the code in the UserForm button procedure that closes the form. The checkbox values are evaluated when the button is clicked, so only the selected checkbox's text is written.
Word deletes a bookmark when its Range.Text is replaced, so store the range and recreate the bookmark after writing if you need to target it again.
In Word, press Alt+F11 to open the VBA editor, locate the UserForm, right-click the submit or close button, and choose View Code.
Inside the button's click procedure, before the form closes, add If Me.Chk1.Value = True Then ActiveDocument.Bookmarks("Bookmark1").Range.Text = "text for bookmark 1".
Add equivalent If blocks for Chk2/Bookmark2 and Chk3/Bookmark3. Because only one checkbox is selected at a time, only the matching bookmark receives text.
Store the bookmark range first with Dim rng As Range and Set rng = ActiveDocument.Bookmarks("Bookmark1").Range, then after setting rng.Text use ActiveDocument.Bookmarks.Add Name:="Bookmark1", Range:=rng to recreate the bookmark.
Run the form, select one checkbox, click the button, and confirm the correct text appears at the target bookmark location.

Use WPS Writer for Word Document Editing When Complex VBA Is Not Required
This checkbox-to-bookmark flow depends on Microsoft Word's VBA UserForm object model. WPS Office is a free, lightweight, easy-to-use alternative that opens Word .doc and .docx files with a familiar interface for everyday document editing and manual bookmark work.
- 1. Download WPS Office Free: Go to the WPS Office download page, download the free installer, and install WPS Writer on your Windows or Mac device.
- 2. Open the existing Word document: Launch WPS Writer, click the Menu button in the top-left, choose Open, and select the .doc or .docx file that contains your bookmarks.
- 3. Edit bookmarks and document content: Use WPS Writer to view and update the document normally. If the VBA UserForm behavior is essential, keep the original file in Microsoft Word for that macro.

Frequently Asked Questions
Where should I put the bookmark-writing VBA code?
Put it in the UserForm button's click procedure, not in checkbox events. In Word, press Alt+F11, right-click the form button, choose View Code, and insert the If Me.CheckBoxName.Value = True Then ActiveDocument.Bookmarks("Name").Range.Text = "text" statements before the form closes.
Why is my bookmark missing after the macro writes text?
Word deletes a bookmark when its Range.Text is replaced. Store the Range in a variable before writing, then use ActiveDocument.Bookmarks.Add to recreate the bookmark with the same name.
Does this VBA code work in WPS Writer?
This specific flow relies on Microsoft Word's VBA UserForm and bookmark object model, so it is not a WPS Writer fix. WPS Writer can open the .doc/.docx file for normal editing, but run the macro in Word if the UserForm behavior is required.
How do I ensure only one checkbox is selected at a time?
In the UserForm, use a group of option buttons or add Click/Change code that sets the other two checkboxes to False whenever one is checked. Then the submit button only sees one True value.
What is the exact syntax for inserting text into a bookmark?
Use ActiveDocument.Bookmarks("Bookmark1").Range.Text = "Your text" inside the button click procedure. Replace Bookmark1 with the actual bookmark name and the text with the value you want to insert.




