Template Issues

How to Control Bookmark Font Formatting in Word Templates

Algirdas JasaitisAlgirdas Jasaitis Oct 12, 2026 869 views

Question details

The user needs a way to maintain specific font formatting when bookmark text is programmatically replaced with generated values.

How to Control Bookmark Font Formatting in Word Templates
Product
Word
Device & OS
not provided
Scenario
Using a third-party application or script to automatically generate Word documents from a predefined template by replacing bookmark text.
Observed behavior
The resulting Word documents fail to preserve the font, size, and formatting defined at the bookmark location within the original template.
Before you start

Ensure you have access to edit the original Word template file and determine whether your automated document generation tool requires traditional bookmarks or supports modern Content Controls.

Solution 1Recommended

Apply a Character Style to the Bookmark Range

Because bookmarks inherit the standard paragraph formatting by default, applying a dedicated character style to the bookmark ensures the replacement text adopts your exact font settings.

By default, bookmarks do not possess independent styling. When text is inserted programmatically, it often falls back to the surrounding paragraph's default font. Creating a specific character style binds the formatting directly to the bookmark text range.

1
Create a New Character Style

Navigate to the Home tab and click the dialog launcher arrow in the bottom right corner of the Styles group (or press Alt+Ctrl+Shift+S). Click the 'New Style' button at the bottom of the pane. In the dialog, name your style and change the 'Style type' from Paragraph to 'Character'.

2
Define Your Formatting

Under the Formatting section, select your desired font, size, color, and any other text attributes you want the generated text to use, then click 'OK' to save the style.

3
Apply Style to the Bookmark

Highlight the text or placeholder space in your template where the bookmark is located. Click on your newly created character style in the Styles pane to apply it strictly to that selected range.

Apply a Character Style to the Bookmark Range
Formatting Preservation: When your application replaces the text, the character style will force the new text to adopt the specified font formatting.
Efficient Document Generation

Create and Format Templates Seamlessly with WPS Writer

WPS Office provides robust tools for building templates, managing bookmarks, and controlling granular document formatting. You can easily set up character styles to ensure your automated documents look perfect every time you generate them.

  1. 1. Open WPS Writer: Launch WPS Office and click on 'Document' to create a new file or open your existing template.
  2. 2. Insert a Bookmark: Navigate to the Insert tab, click on 'Bookmark', type a recognized name for your placeholder, and click 'Add'.
  3. 3. Define a Character Style: Go to the Home tab, click the Styles and Formatting icon to open the right-side panel, create a new Character Style with your desired font, and apply it to the bookmark.
  4. 4. Save as Template: Click Menu > Save As, and choose 'Word Template (*.dotx)' to save your perfectly formatted layout for automated generation.
Highly compatible with Microsoft Word formats (.docx, .dotx)Intuitive style management and text formatting toolsSupport for inserting and managing bookmarks effortlesslyLightweight application with a user-friendly, familiar interface
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Word bookmarks lose formatting when text is replaced?

By default, bookmarks act merely as positional markers and do not possess independent styles. When an application programmatically replaces the bookmark with new text, the text inherits the default paragraph style rather than retaining the visual formatting you may have manually applied to the bookmark placeholder.

What is the difference between a bookmark and a content control?

A bookmark is a named location or selection of text that can easily be overwritten or accidentally deleted by users. A content control is a dedicated structural container designed specifically to hold data, making it much more robust for templates and automated document generation.

How do I ensure a replaced bookmark uses bold formatting?

You must create a new Character Style in your Styles pane, set its formatting to Bold, and apply this specific Character Style to the placeholder text of the bookmark in your template. The generated text will then inherit this applied character formatting.