How to Fix Escape Characters in Word IF Field Results
Question details
The user needs to fix incorrectly displayed backslashes or quotation marks in Word field results involving nested IF and REF fields.

- 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.
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.
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.
Press Alt + F9 on your keyboard to display the raw field codes instead of their results in the document.
Find the specific IF or REF fields that are causing the display issues and causing backslashes to appear.
Delete any backslashes (\) that were intended to escape quotation marks within the formula.
To insert a quotation mark in the result, use { QUOTE 34 } or Word-compatible smart quotes instead of trying to escape a standard quote.
Select the text, press F9 to update the field, and then press Alt + F9 to toggle back to the result view.

Isolate and Test Nested IF and REF Fields
Break down complex nested fields to identify exactly which part of the field logic is causing the syntax error.
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. Open your document: Launch WPS Writer and open the document containing the field codes.
- 2. Insert fields: Go to the Insert tab, click on Parts, and select Field to browse available codes.
- 3. Configure field properties: Select the IF or REF field from the list and use the dialog box to configure its logic safely.
- 4. Toggle and edit: Use the Alt + F9 shortcut to easily toggle between field codes and results for quick editing and troubleshooting.

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.




