Skip to main content

Kutools for Office β€” One Suite. Five Tools. Get More Done.

How to quickly convert field codes to text in Word

Author Sun Last modified

If you need to convert field codes to plain text in Word, this tutorial will guide you through different methods depending on your needs. The first method converts field codes to their displayed values, preserving only the visible content. The other two methods retain the field codes as text, displaying them in their raw format, such as { SEQ Table \* ARABIC }.

Convert field codes to displayed values with a shortcut

Convert field codes to text with Kutools for Word

Convert field codes to text with VBA

Recommended Productivity Tools for Word

Kutools for Word: Integrating AI πŸ€–, over 100 advanced features save 50% of your document handling time.Free Download

Office Tab: Introduces the browser-like tabs to Word (and other Office tools), simplifying multi-document navigation.Free Download


Convert field codes to plain text with a shortcut

If you only need to remove the field functionality while keeping the displayed values, you can use a simple shortcut:

  1. Select the entire document by pressing Ctrl + A. Tip: If you want to convert field codes in a specific range, select only that portion instead of the entire document.
  2. Press Ctrl + Shift + F9 to convert all fields to their displayed values.
    Field Codes converted to displayed values

Note: This method keeps only the current field values. If you need to retain the field codes as text, displaying them in their raw format, such as { SEQ Table \* ARABIC }, use the methods below.


Convert field codes to text with Kutools for Word

Kutools for Word provides a simple way to convert field codes to text, either from the whole document or a selected portion.

Kutools for Word, equipped with AI πŸ€–, offers over 100 handy features to simplify your tasks.
  • If you want to convert field codes to text within a specific range, first select the range, then click Kutools > Convert > Convert Field Codes to Text.
    Convert Field Codes to Text option on the Kutools tab on the ribbon
  • If you want to convert field codes in the entire document, simply apply the feature by clicking Kutools > Convert > Convert Field Codes to Text without selecting anything in the document. A prompt box will then appear asking for confirmation. Click Yes to proceed.
    Convert Field Codes to Text dialog

All field codes in the selected range or within the entire document will be converted to plain text.

Document with field codes >>> Document with field codes converted to text

Click here for more details about Kutools for Word's Convert Field Codes to Text.

Kutools for Word is the ultimate Word add-in that streamlines your work and boosts your document processing skills. Get It Now!

Convert field codes to text with VBA

VBA offers a powerful way to handle field codes in Word documents. Depending on the script used, you can either extract all field codes and save them as text in a new document or replace the field codes in the original document with their actual code representation (e.g., { SEQ Table \* ARABIC }).

  1. Press Alt + F11 to open the Microsoft Visual Basic for Applications window.
  2. Click Module from the Insert tab, then copy and paste one of the following VBA codes into the module window.

    Note: The VBA codes below provide two different outcomes. Choose the one that suits your needs.

    VBA 1: Extract field codes and save them in a new Word document

    Sub fieldcodetotext()
    Dim MyString As String
    For Each aField In ActiveDocument.Fields
        aField.Select
        MyString = MyString & vbCr & Selection.Fields(1).Code.Text
    Next aField
    Documents.Add
    ActiveDocument.Content.InsertAfter MyString
    End Sub

    VBA 2: Replace field codes with their code representation in the original document

    Sub fieldcodetotext()
    Dim MyString As String
    ActiveWindow.View.ShowFieldCodes = True
    For Each aField In ActiveDocument.Fields
        aField.Select
        MyString = "{ " & Selection.Fields(1).Code.Text & " }"
        Selection.Text = MyString
    Next aField
    ActiveWindow.View.ShowFieldCodes = False
    End Sub
  3. Click the Run button Run button or press F5 to execute the VBA.

Note: This VBA method does not work on selected portions of the document; it applies to the entire document.

Office Tab: Brings tabbed interfaces to Word, Excel, PowerPoint...
Navigate through documents using Office Tab
Enhance your workflow now.      Learn More about Office Tab       Free Download

Related articles:


Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

πŸ€– Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish (Preserve Format) / Super Translate (Preserve Format) / AI Redaction / AI Proofread...

πŸ“˜ Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF...

✏ Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text...

🧹 Effortless Clean: Sweap away Extra Spaces / Section Breaks / Text Boxes / Hyperlinks / For more removing tools, head to the Remove group...

βž• Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Multiple Pictures / Discover more in the Insert group...

πŸ” Precision Selections: Pinpoint Specific Pages / Tables / Shapes / Heading Paragraphs / Enhance navigation with more Select features...

⭐ Star Enhancements: Navigate to Any Location / Auto-Insert Repetitive Text / Toggle Between Document Windows / 11 Conversion Tools...

🌍 Supports 40+ Languages: Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Kutools and Kutools Plus tabs on the Word Ribbon
πŸ‘‰ Want to try these features? Download Kutools for Word now! πŸš€
 

✨ Kutools for Office – One Installation, Five Powerful Tools!

Includes Office Tab Pro Β· Kutools for Excel Β· Kutools for Outlook Β· Kutools for Word Β· Kutools for PowerPoint

πŸ“¦ Get all 5 tools in one suite | πŸ”— Seamless integration with Microsoft Office | ⚑ Save time and boost productivity instantly

Best Office Productivity Tools

Kutools for Word - 100+ Tools for Word