How to Automatically Add Custom Chapter-Based Captions in Word
Question details
The user needs to automatically insert bold figure captions with chapter-based numbering using custom heading styles, a StyleRef field, and a SEQ field.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Setting up an automated way to number figures by chapter when the document uses custom heading styles instead of Word's default Heading styles.
- Observed behavior
- Word's built-in caption numbering feature is limited because it relies entirely on built-in Heading styles, failing to recognize and link chapter numbers to custom heading styles without a manual workaround.
Ensure that your custom heading styles are consistently applied to all chapter titles throughout your document before configuring the automated field codes.
Create a Reusable AutoText Entry for Custom Captions
Since Word's default caption tool doesn't support custom headings natively, manually creating the field codes once and saving them as an AutoText entry allows you to easily insert correctly formatted captions with a keyboard shortcut.
This solution uses the StyleRef field to pull the chapter number from your custom heading style and the SEQ field to sequentially number the figures within that chapter.
In your document, type 'Figure ', then press Ctrl+F9 to insert a field bracket. Type 'StyleRef "Your Custom Heading Name" \s' inside the bracket. Type a hyphen '-', then press Ctrl+F9 again and type 'SEQ Figure \* ARABIC \s "Your Custom Heading Name"'. Format the entire line as bold.
Select the entire caption line you just created. Go to Insert > Quick Parts > AutoText, and click 'Save Selection to AutoText Gallery'. Give it a memorable name like 'CustomFigCaption'.
Go to File > Options > Customize Ribbon, and click 'Customize' next to Keyboard shortcuts. In Categories, scroll down to Building Blocks. Find your 'CustomFigCaption' entry, assign a shortcut key (e.g., Alt+C), and click Assign.
Whenever you insert a new image, simply press your assigned keyboard shortcut to instantly add your custom chapter-based caption. Update the descriptive text manually as needed.

Use a VBA Macro to Programmatically Add Captions
If you are processing numerous images or need deeper automation, using a VBA script allows you to insert images and apply the custom caption field codes simultaneously.
Easily Add and Manage Captions in WPS Writer
If wrestling with complex field codes and VBA macros is slowing down your productivity, WPS Office offers an intuitive interface for managing references, formatting documents, and inserting automated captions with high compatibility.
- 1. Open your document: Launch WPS Office and open your text document in WPS Writer.
- 2. Navigate to the References tab: Click on 'References' in the top ribbon menu, then select 'Insert Caption'.
- 3. Configure your caption label: Choose an existing label like 'Figure' or click 'New Label' to create a custom one.
- 4. Enable chapter numbering: Click the 'Numbering' button, check 'Include chapter number', select your preferred heading style, and click OK to apply.

Frequently Asked Questions
Why doesn't Word's default 'Include chapter number' work with custom styles?
Word's built-in caption numbering tool is strictly hardcoded to recognize only its default Heading 1 through Heading 9 styles. If your chapter titles use a custom style name, the built-in tool cannot link to them, requiring manual field codes or AutoText as a workaround.
What do the StyleRef and SEQ field codes do in a caption?
The StyleRef field dynamically searches your document for the most recent text formatted with a specific style (like your custom chapter heading) and displays it. The SEQ (Sequence) field generates an automatically incrementing number for elements like figures or tables.
How do I update all my custom captions at once?
Because custom captions rely on field codes, they may not update in real-time when you move or insert new figures. To update them all, simply select your entire document by pressing Ctrl + A, and then press F9 to refresh all fields.




