# WordMailMergeTemplateInspection

Describes the merge fields, conditional blocks, and validation issues found in a Word mail-merge template.

Class 

`OfficeIMO.Word`

**Namespace**

`OfficeIMO.Word`

**Assembly**

`OfficeIMO.Word`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[WordMailMerge.Models.cs:193](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Word/WordMailMerge.Models.cs#L193)

**Modifiers**

sealed

Describes the merge fields, conditional blocks, and validation issues found in a Word mail-merge template.

## Inheritance

- object
- WordMailMergeTemplateInspection

## Usage

Explore 4 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 [WordMailMerge.InspectTemplate](/api/word/officeimo-word-wordmailmerge/#method-inspecttemplate-officeimo-word-worddocument-collections-generic-ienumerable-system-string-collections-generic-ienumerable-system-string-collections-generic-ienumerable-system-string)
- Method [WordMailMerge.ValidateTemplate](/api/word/officeimo-word-wordmailmerge/#method-validatetemplate-officeimo-word-worddocument-collections-generic-ienumerable-system-string-collections-generic-ienumerable-system-string)
- Method [WordMailMergeTemplateInspection.EnsureValid](/api/word/officeimo-word-wordmailmergetemplateinspection/#method-ensurevalid)

### Accepted by parameters 1

- Method [WordTemplatePreflightReport.FromInspection](/api/word/officeimo-word-wordtemplatepreflightreport/#method-frominspection-officeimo-word-wordmailmergetemplateinspection) parameter `inspection`

Filter members 

Show inherited

## Methods

`public WordMailMergeTemplateInspection EnsureValid()` [#](#method-ensurevalid)

[WordMailMerge.Models.cs:193](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Word/WordMailMerge.Models.cs#L193)

Throws when validation issues were found, otherwise returns this inspection.

Returns

`WordMailMergeTemplateInspection`

## 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 IReadOnlyList<string> MergeFieldNames { get; }` [#](#property-mergefieldnames)

[WordMailMerge.Models.cs:175](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Word/WordMailMerge.Models.cs#L175)

Unique MERGEFIELD names found in the template.

`public IReadOnlyList<string> ConditionalBlockNames { get; }` [#](#property-conditionalblocknames)

[WordMailMerge.Models.cs:178](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Word/WordMailMerge.Models.cs#L178)

Unique conditional block names found in the template.

`public IReadOnlyList<string> RepeatingBlockNames { get; }` [#](#property-repeatingblocknames)

[WordMailMerge.Models.cs:181](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Word/WordMailMerge.Models.cs#L181)

Unique repeated block names found in the template.

`public IReadOnlyList<WordMailMergeTemplateIssue> Issues { get; }` [#](#property-issues)

[WordMailMerge.Models.cs:184](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Word/WordMailMerge.Models.cs#L184)

Validation issues found during inspection.

`public bool IsValid { get; }` [#](#property-isvalid)

[WordMailMerge.Models.cs:187](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Word/WordMailMerge.Models.cs#L187)

True when the template has no validation issues.

<!-- PowerForge markdown artifact sha256:19C7F2A64098A496FB9B7687DAFB4983CF1266D601591014424ED98CCC48E5AF -->
