Table of Contents

Method ReplaceWithText

Namespace
DocWright.Dom.Fields
Assembly
DocWright.Dom.dll

ReplaceWithText(string, CharacterFormat?)

Replaces the whole field — markup, instruction and result — with literal text.

public TextRun? ReplaceWithText(string text, CharacterFormat? format = null)

Parameters

text string

The replacement text. An empty string removes the field outright.

format CharacterFormat

The formatting for the replacement, or null to inherit ResultFormat.

Returns

TextRun

The inserted run, or null when text was empty.

Exceptions

ArgumentNullException

text is null.

InvalidOperationException

The region has already been edited away.