Class MergeField
Represents a discovered mail merge field within a Word document.
Inheritance
Namespace: IronWord.Models.MailMerge
Assembly: IronWord.dll
Syntax
public class MergeField : Object
Constructors
MergeField(String, String, MergeFieldKind)
Initializes a new instance of the MergeField class.
Declaration
public MergeField(string name, string instruction, MergeFieldKind kind)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The merge field name parsed from the field instruction. |
| System.String | instruction | The full field instruction text (e.g. " MERGEFIELD FirstName * MERGEFORMAT "). |
| MergeFieldKind | kind | The kind of merge field. |
Properties
Instruction
Gets the full field instruction text as stored in the document
(e.g. MERGEFIELD FirstName * MERGEFORMAT ).
Declaration
public string Instruction { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Kind
Gets the kind of merge field (a regular value field, a region marker, or a Next-record marker).
Declaration
public MergeFieldKind Kind { get; }
Property Value
| Type | Description |
|---|---|
| MergeFieldKind |
Name
Gets the merge field name (the identifier following MERGEFIELD in the instruction).
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
RegionName
Gets the region name when Kind is TableStart or TableEnd; otherwise an empty string.
Declaration
public string RegionName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |