Skip to content

word fieldchar

goworm edited this page Jun 26, 2026 · 1 revision

Word: Field Character

Field-character marker (w:fldChar) — an inline atom that delimits a complex field's begin / separate / end boundaries.

Path: /body/p[@paraId=X]/r[N]

Operations

  • set - Adjust an existing field character's type
  • get - Read a field character's type
  • query - Find field characters
  • remove - Delete a field character

set

Parent: paragraph

Properties

Property Required/Default Description
fieldCharType required Boundary type: begin, separate, or end. Aliases: fieldchartype.

get Attributes

Attribute Type Description
fieldCharType enum The fldChar fldCharType attribute (begin, separate, or end).

Examples

# Read a field character's type
officecli get report.docx "/body/p[@paraId=X]/r[N]"

# Change a field character's boundary type
officecli set report.docx "/body/p[@paraId=X]/r[N]" --prop fieldCharType=separate

# Find all field characters
officecli query report.docx fieldChar

# Remove a field character
officecli remove report.docx "/body/p[@paraId=X]/r[N]"

Notes

  • Atomic add is intentionally NOT supported — a fldChar in isolation is invalid OOXML. To insert a complete field, use --type field, which writes a full begin + instrText + separate + cached + end sequence as one unit.
  • get/set on individual field characters supports audit→fix workflows: inspect an existing field's structure and adjust it in place.
  • Field characters appear inside runs, so the path targets a run (r[N]) within a body, header, or footer paragraph.

See Also

  • Field - Insert complete fields as a single unit
  • Run - The inline run that contains a field character
  • Paragraph - The parent element
  • Word Reference - All Word elements

Based on OfficeCLI v1.0.119

Clone this wiki locally