Document Editing Problems

How to Combine TC Field \f and \o Switches in a WPS Writer TOC

Olivia MillerOlivia Miller Nov 13, 2026 868 views

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.

How to Combine TC Field \f and \o Switches in a WPS Writer TOC
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.
Before you start

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.

Solution 1Recommended

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.

1
Reveal field codes

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.

2
Inspect the existing TOC field

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" }.

3
Create explicit TC entries

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.

4
Edit the TOC field

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.

5
Update the TOC and verify levels

Click inside the TOC and press F9, choose Update entire table when prompted, then confirm only group A entries appear at their assigned levels.

Use Explicit \l Levels in TC Fields and a Separate TOC Field for Each Group
Switch combination works when levels are explicit: Adding the \l switch to each TC field prevents the TOC from dropping level information when \f and \o are combined.
WPS Writer TOC field solution

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. 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. 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. 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. 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. 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.
Filter TOC entries by group identifier and heading level using \f, \o, and \l switch support in WPS Writer.Open and save Word 2016 .docx files with TOC and TC field codes intact.Free, lightweight Office suite with a familiar Writer interface.Update TOCs quickly while maintaining format compatibility with Microsoft Word documents.
microsoft office alternative - wps office

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.