Document Editing Problems

How to Fix Escape Characters in Word IF Field Results

John WilsonJohn Wilson Oct 29, 2026 868 views

Question details

The user needs to fix incorrectly displayed backslashes or quotation marks in Word field results involving nested IF and REF fields.

How to Fix Escape Characters in Word IF Field Results
Product
Word
Device & OS
not provided
Scenario
Using nested IF and REF fields in a document that require specific string outputs containing quotation marks.
Observed behavior
Field results incorrectly display backslashes or quotation marks due to unsupported escape-character syntax within the field codes.
Before you start

Press Alt + F9 (or Option + F9 on Mac) to toggle field codes on, allowing you to view and edit the raw IF and REF field formulas before troubleshooting.

Solution 1Recommended

Review Field Codes and Replace Unsupported Escapes

Word does not support standard backslash escaping (like \") inside field codes. Use character codes instead to display quotation marks correctly.

Many programming languages use a backslash to escape quotation marks, but Microsoft Word field codes do not recognize this syntax. Using backslashes will cause them to appear as literal text in your final document.

1
Toggle field codes

Press Alt + F9 on your keyboard to display the raw field codes instead of their results in the document.

2
Locate the nested fields

Find the specific IF or REF fields that are causing the display issues and causing backslashes to appear.

3
Remove backslash escapes

Delete any backslashes (\) that were intended to escape quotation marks within the formula.

4
Use character codes instead

To insert a quotation mark in the result, use { QUOTE 34 } or Word-compatible smart quotes instead of trying to escape a standard quote.

5
Update fields

Select the text, press F9 to update the field, and then press Alt + F9 to toggle back to the result view.

Review Field Codes and Replace Unsupported Escapes
Tip: Ensure you use Ctrl + F9 to insert the curly brackets {} for the QUOTE field. Typing them manually on the keyboard will not work.
Edit Documents in WPS Writer

Manage Field Codes Easily with WPS Writer

WPS Writer fully supports standard field codes for document automation. You can easily insert, view, and edit IF and REF fields without dealing with complex workarounds, ensuring your dynamic documents look perfect every time.

  1. 1. Open your document: Launch WPS Writer and open the document containing the field codes.
  2. 2. Insert fields: Go to the Insert tab, click on Parts, and select Field to browse available codes.
  3. 3. Configure field properties: Select the IF or REF field from the list and use the dialog box to configure its logic safely.
  4. 4. Toggle and edit: Use the Alt + F9 shortcut to easily toggle between field codes and results for quick editing and troubleshooting.
Easily toggle and edit field codes with standard shortcutsHighly compatible with Microsoft Word DOCX files and fieldsIntuitive interface for document automation and mail mergeFree and lightweight word processing alternative
QA img-9

Frequently Asked Questions

Why do backslashes appear in my Word IF field results?

Word field codes do not use backslashes (\) to escape characters like quotation marks. If you include a backslash before a quote, Word treats it as literal text and displays it in the final document result.

How can I insert a quotation mark inside a Word field code?

Instead of escaping the quote with a backslash, you can use the QUOTE field with its ASCII character code. Insert { QUOTE 34 } where you need the quotation mark to appear in your field result.

What is the shortcut to view field codes in Word?

You can press Alt + F9 on Windows (or Option + F9 on Mac) to toggle between viewing the raw field codes and their actual results. Pressing it again will revert to the standard view.