How to Combine TC Field \f and \o Switches in a WPS Writer TOC
Question details
The user needs to combine the \f group identifier and \o heading-level switches in a table of contents so that TC entries are filtered by both group identifier and required heading level.

- Product
- WPS Writer and Microsoft Word 2016
- Device & OS
- not provided
- Scenario
- Creating or repairing a table of contents that must include only TC entries from a specific group and at a specific heading level.
- Observed behavior
- The table of contents does not correctly filter TC entries by both group identifier and heading level when the \f and \o switches are combined; entries can be omitted or appear at the wrong level.
Open the document in WPS Writer and press Alt+F9 to display field codes. If the document originated in Word 2016, confirm that the TOC field and all TC entries are visible before changing switches.
Use Explicit \l Levels in TC Fields and a Separate TOC Field for Each Group
Use this when the TOC must respect both a group identifier and an outline level, or when combined \f and \o switches return incorrect entries.
In Word 2016 and WPS Writer, the \f switch filters TC entries by group identifier, while the \o switch builds a TOC from built-in heading styles and outline levels. When you combine them, each TC field needs an explicit \l level so the TOC can place the entry correctly.
If you need multiple groups, create one TOC field per group or use separate TC fields with different identifiers.
Open the document in WPS Writer and press Alt+F9 to toggle field codes so the TOC field and TC entries appear as field code text.
Click inside the current table of contents and press Shift+F9 to expand that field, then note the current switches, such as { TOC \o "1-3" }.
Place the cursor immediately before the target heading, press Ctrl+F9 to insert a field, and type TC "Entry text" \f A \l 1. Replace A with your group identifier and 1 with the required heading level.
In the TOC field, enter { TOC \f A \o "1-3" } so the TOC filters by group A and then applies outline levels 1 through 3.
Click inside the TOC and press F9, choose Update entire table when prompted, then confirm only group A entries appear at their assigned levels.

Exclude Built-in Heading Styles and Move TC Fields Outside Heading Paragraphs
Use this when built-in Heading styles are being included unexpectedly or when TC fields inside heading paragraphs are ignored by the combined TOC.
Create a Group- and Level-Filtered TOC in WPS Writer
WPS Office Writer can open Word 2016 documents, edit TOC and TC field codes, and let you combine the \f, \o, and \l switches to build a precise table of contents without paying for Office.
- 1. Install WPS Office: Download WPS Office from the official WPS website, run the installer, and open the Word 2016 document in WPS Writer.
- 2. Display field codes: Press Alt+F9 in WPS Writer to show field codes, or use the View tab to reveal the TOC and TC fields.
- 3. Edit the TOC field: Click inside the TOC, press Shift+F9 to expand the field, and type { TOC \f A \o "1-3" } to filter by group A and heading levels 1-3.
- 4. Add TC entries with explicit levels: Place the cursor before each desired heading, press Ctrl+F9, and enter TC "Heading text" \f A \l 1, replacing A and 1 with your group and level.
- 5. Update and verify: Click the TOC, press F9, choose Update entire table, and confirm that the table shows only the intended group and levels.

Frequently Asked Questions
Why is my TOC field showing built-in heading styles even though I used \f and \o together?
The \o switch still includes built-in heading styles. Either remove the \o switch from the TOC field or place TC entries outside heading paragraphs so only the TC-marked entries are selected.
How do I view and edit field codes in WPS Writer?
Press Alt+F9 to toggle all field codes, or click inside a field and press Shift+F9 to expand only that field. You can then edit the TOC or TC field directly.
Do I need a separate TOC field for each TC group identifier?
Yes, each TOC field uses one \f identifier. Create one TOC field for each group, each with the required \f switch, and assign \l levels in the corresponding TC entries.
Will WPS Writer preserve TOC and TC field switches when I save back to Word format?
Yes, WPS Writer supports Word .docx field codes. Save as .docx to keep the TOC field, TC entries, and switches for Microsoft Word 2016 compatibility.




