# RtfField

RTF field with instruction text and rich inline result content.

Class 

`OfficeIMO.Rtf`

**Namespace**

`OfficeIMO.Rtf`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfField.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L7)

**Implements**

`IRtfCloneable` `IRtfInline`

**Modifiers**

sealed

RTF field with instruction text and rich inline result content.

## Inheritance

- object
- RtfField

## Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 3

- Method [RtfField.SetFormFieldData](/api/rtf/officeimo-rtf-rtffield/#method-setformfielddata-action-officeimo-rtf-rtfformfielddata)
- Method [RtfParagraph.AddEquationField](/api/rtf/officeimo-rtf-rtfparagraph/#method-addequationfield-string-string)
- Method [RtfParagraph.AddField](/api/rtf/officeimo-rtf-rtfparagraph/#method-addfield-string)

Filter members 

Show inherited

## Constructors

`public RtfField(string instruction)` [#](#constructor-ctor-string)

[RtfField.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L7)

Creates an RTF field.

Parameters

**instruction string required**

## Methods

`public RtfRun AddText(string text)` [#](#method-addtext-string)

[RtfField.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L81)

Adds visible result text.

Parameters

**text string required**

Returns

`RtfRun`

`public RtfFormFieldData GetOrCreateFormFieldData()` [#](#method-getorcreateformfielddata)

[RtfField.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L68)

Creates form-field metadata if it does not already exist and returns it.

Returns

`RtfFormFieldData`

`public RtfHyperlinkFieldInfo GetOrCreateHyperlinkField()` [#](#method-getorcreatehyperlinkfield)

[RtfField.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L59)

Creates hyperlink field metadata if it does not already exist and returns it.

Returns

`RtfHyperlinkFieldInfo`

`public RtfField SetFormFieldData(Action<RtfFormFieldData> configure)` [#](#method-setformfielddata-action-officeimo-rtf-rtfformfielddata)

[RtfField.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L74)

Configures Word form-field metadata for this field.

Parameters

**configure System.Action<OfficeIMO.Rtf.RtfFormFieldData> required**

Returns

`RtfField`

`public string ToPlainText()` [#](#method-toplaintext)

[RtfField.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L86)

Returns visible field result text.

Returns

`string`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Instruction { get; set; }` [#](#property-instruction)

[RtfField.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L16)

Raw field instruction text, for example PAGE \* MERGEFORMAT.

`public RtfFieldCodeSyntax FieldCode { get; private set; }` [#](#property-fieldcode)

[RtfField.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L25)

Lossless typed syntax for [RtfField.Instruction](/api/rtf/officeimo-rtf-rtffield/).

`public RtfParagraph Result { get; private set; }` [#](#property-result)

[RtfField.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L28)

Visible field result content.

`public RtfHyperlinkFieldInfo? HyperlinkField { get; set; }` [#](#property-hyperlinkfield)

[RtfField.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L31)

Parsed metadata for HYPERLINK fields. The raw [RtfField.Instruction](/api/rtf/officeimo-rtf-rtffield/) remains authoritative.

`public bool IsEquation { get; }` [#](#property-isequation)

[RtfField.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L36)

Gets whether this is a Word EQ mathematical equation field.

`public Uri? Hyperlink { get; set; }` [#](#property-hyperlink)

[RtfField.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L42)

Parsed hyperlink target for HYPERLINK fields.

`public RtfFormFieldData? FormFieldData { get; set; }` [#](#property-formfielddata)

[RtfField.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfField.cs#L64)

Optional Word form-field metadata from an RTF \ffdata destination.

<!-- PowerForge markdown artifact sha256:5C362E42FF22ABEDF481D58CE3A95B872306CB3A941A05B1DDD62AF9A55A5038 -->
