When you create professional documents, automating headers and footers using the StyleRef field saves hours of manual updates. However, a common challenge arises when the casing of your chapter titles or headings does not match the formatting you want in your header. For instance, your document body might use standard sentence case for readability, but your company's style guide requires all headers to appear in uppercase. changing Text Case with StyleRef Fields in Microsoft Word ensures your page layouts look polished without forcing you to compromise the original text formatting in the document body. By modifying the underlying field codes with specific format switches, you can force the referenced text to appear in uppercase, lowercase, or title case automatically.
Accessing and Modifying Field Codes

Unlike standard text, information pulled into headers and footers via StyleRef is controlled by dynamic field codes. These codes remain hidden by default to prevent accidental edits. To change the text case, you must first reveal the code that controls how the text is displayed. Modifying this code directly is the most reliable way to enforce a specific text case throughout your document.
- Double-click the header or footer area of your document to open it for editing.
- Place your cursor inside the text generated by the StyleRef field.
- Press Alt + F9 on your keyboard. This toggles the document view to display field codes instead of field results. You will see a code formatted similarly to { STYLEREF "Heading 1" }.
- Position your typing cursor inside the closing bracket } of the field code.
- Type a space, followed by your desired format switch, such as \* Upper. The complete code should now look like { STYLEREF "Heading 1" \* Upper }.
- Press Alt + F9 again to hide the field codes and return to the standard document view.
- Select the field or press Ctrl + A, then press F9 to update the field and apply the new text case.
Supported Format Switches for Text Casing
Format switches act as instructions telling the software exactly how to render the pulled text. You can append one of four primary text case switches to the end of your StyleRef field code. Ensure you include a space before the asterisk and type the switch exactly as shown to prevent syntax errors.
| Format Switch | Function | Example Output |
|---|---|---|
| \* Upper | Converts all alphabetical characters in the referenced text to uppercase. | EXECUTIVE SUMMARY |
| \* Lower | Converts all alphabetical characters in the referenced text to lowercase. | executive summary |
| \* Caps | Capitalizes the first letter of every word, commonly known as Title Case. | Executive Summary |
| \* FirstCap | Capitalizes only the first letter of the first word in the referenced string. | Executive summary |
Preserving Formatting with the MergeFormat Switch
When you insert a StyleRef field via the standard menu, the software often automatically appends a \* MERGEFORMAT switch to the end of the code. This specific switch ensures that any direct formatting applied to the field result (such as bolding or highlighting) remains intact when the field updates. If you are adding a text case switch, you must place it before the merge format command to ensure both instructions execute correctly.
For example, if your original field code is { STYLEREF "Heading 1" \* MERGEFORMAT }, you should modify it to read { STYLEREF "Heading 1" \* Upper \* MERGEFORMAT }. If you delete the merge format switch during this process, any manual font coloring or sizing applied directly to the header text will be lost the next time the document repaginates or updates the field.
Managing StyleRef Text Case in WPS Office

If you prefer a lightweight, broadly compatible alternative for document editing, WPS Office provides seamless support for standard field codes, including the StyleRef function. Because WPS Writer utilizes the same native .docx architecture for fields, you can manage dynamic headers and format switches without encountering compatibility errors or needing to reconfigure your document layouts.
To adjust the text case of a StyleRef field within WPS Office, follow a nearly identical workflow. Double-click the header area to activate it. Right-click directly on the referenced text and select Toggle Field Codes from the context menu. This action reveals the underlying bracketed code. Insert your preferred format switch, such as \* Caps, right before the closing bracket. Once modified, right-click the code again, choose Toggle Field Codes to hide the raw syntax, and then right-click a final time to select Update Field. WPS Office will instantly process the switch and display the updated casing. Additionally, WPS Office's built-in PDF tools and AI-assisted writing features make it an excellent comprehensive suite for users who frequently manage complex, heavily formatted reports but want to avoid another paid subscription models.
Frequently Asked Questions
Why isn't my StyleRef field updating after I change the text case switch?
Field codes do not update automatically in real-time as you type. After adding or modifying a format switch like \* Upper, you must manually refresh the field. You can do this by selecting the field and pressing the F9 key, or by right-clicking the field and selecting Update Field. Alternatively, opening the Print Preview screen will automatically force all fields in the document to refresh.
Can I apply different text cases to multiple StyleRef fields referencing the same style?
Yes, each field code operates entirely independently. You can pull the same "Heading 1" style into different parts of your document and apply different switches to each. For example, you can use { STYLEREF "Heading 1" \* Upper } in the primary page header, and { STYLEREF "Heading 1" \* Caps } in a table of contents or summary section on the same page.
Does modifying the field code change the text case of my original heading?
No, adding a format switch to a StyleRef field only alters how the text is displayed at the location of the field itself (typically in the header or footer). The original source text located in the body of your document will remain exactly as you typed it, preserving your desired sentence casing for the main content.
What happens if I apply a format switch to a StyleRef field containing numbers?
Text case switches like \* Upper or \* Lower only affect alphabetical characters. If your referenced heading includes numbers or special punctuation (for example, "Chapter 1: Overview"), the numbers and punctuation will remain unchanged, while the alphabetical letters will convert to the requested case, resulting in "CHAPTER 1: OVERVIEW".




