# WordTemplatePreflightReport

Summarizes whether a Word mail-merge template can be safely bound with supplied data.

Class 

`OfficeIMO.Word`

**Namespace**

`OfficeIMO.Word`

**Assembly**

`OfficeIMO.Word`

**Source revision**

`07c6bff0a794` with working tree changes

**Source**

[WordTemplatePreflightReport.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L68)

**Modifiers**

sealed

Summarizes whether a Word mail-merge template can be safely bound with supplied data.

## Inheritance

- object
- WordTemplatePreflightReport

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Generate Word Documents from DOCX Templates](/docs/word/templates/) Guide
  
  Fill DOCX templates from C# data with placeholders, repeated and conditional blocks and images, run MERGEFIELD mail merge, and fill content controls.

## 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 [WordMailMerge.PreflightTemplate](/api/word/officeimo-word-wordmailmerge/#method-preflighttemplate-officeimo-word-worddocument-collections-generic-ienumerable-system-string-collections-generic-ienumerable-system-string-collections-generic-ienumerable-system-string)
- Method [WordTemplatePreflightReport.EnsureCan](/api/word/officeimo-word-wordtemplatepreflightreport/#method-ensurecan-officeimo-word-wordtemplatepreflightcapability)
- Method [WordTemplatePreflightReport.FromInspection](/api/word/officeimo-word-wordtemplatepreflightreport/#method-frominspection-officeimo-word-wordmailmergetemplateinspection)

Filter members 

Show inherited

## Methods

`public bool Can(WordTemplatePreflightCapability capability)` [#](#method-can-officeimo-word-wordtemplatepreflightcapability)

[WordTemplatePreflightReport.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L76)

Returns whether the requested template binding capability has no blocking diagnostics.

Parameters

**capability OfficeIMO.Word.WordTemplatePreflightCapability required**

Capability to check.

Returns

`bool`

`public WordTemplatePreflightReport EnsureCan(WordTemplatePreflightCapability capability)` [#](#method-ensurecan-officeimo-word-wordtemplatepreflightcapability)

[WordTemplatePreflightReport.cs:106](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L106)

Throws when the requested capability has blocking diagnostics, otherwise returns this report.

Parameters

**capability OfficeIMO.Word.WordTemplatePreflightCapability required**

Capability to enforce.

Returns

`WordTemplatePreflightReport`

`public static WordTemplatePreflightReport FromInspection(WordMailMergeTemplateInspection inspection)` [#](#method-frominspection-officeimo-word-wordmailmergetemplateinspection)

[WordTemplatePreflightReport.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L68)

Creates a preflight report from an existing template inspection.

Parameters

**inspection OfficeIMO.Word.WordMailMergeTemplateInspection required**

Template inspection returned by [WordMailMerge.InspectTemplate](/api/word/officeimo-word-wordmailmerge/).

Returns

`WordTemplatePreflightReport`

`public IReadOnlyList<WordMailMergeTemplateIssue> GetDiagnostics(WordTemplatePreflightCapability capability)` [#](#method-getdiagnostics-officeimo-word-wordtemplatepreflightcapability)

[WordTemplatePreflightReport.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L86)

Returns diagnostics that block the requested template binding capability.

Parameters

**capability OfficeIMO.Word.WordTemplatePreflightCapability required**

Capability to inspect.

Returns

`IReadOnlyList<WordMailMergeTemplateIssue>`

`public string ToJson()` [#](#method-tojson)

[WordTemplatePreflightReport.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L118)

Serializes this report to deterministic JSON for CI and service logs.

Returns

`string`

`public string ToMarkdown()` [#](#method-tomarkdown)

[WordTemplatePreflightReport.cs:137](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L137)

Renders this report as Markdown suitable for review notes and automation logs.

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

[WordTemplatePreflightReport.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L37)

Unique MERGEFIELD names found in the template.

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

[WordTemplatePreflightReport.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L40)

Unique conditional block names found in the template.

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

[WordTemplatePreflightReport.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L43)

Unique repeated block names found in the template.

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

[WordTemplatePreflightReport.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L46)

Validation issues found during template inspection.

`public int MergeFieldCount { get; }` [#](#property-mergefieldcount)

[WordTemplatePreflightReport.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L49)

Number of unique MERGEFIELD names found in the template.

`public int ConditionalBlockCount { get; }` [#](#property-conditionalblockcount)

[WordTemplatePreflightReport.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L52)

Number of unique conditional block names found in the template.

`public int RepeatingBlockCount { get; }` [#](#property-repeatingblockcount)

[WordTemplatePreflightReport.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L55)

Number of unique repeated block names found in the template.

`public int IssueCount { get; }` [#](#property-issuecount)

[WordTemplatePreflightReport.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L58)

Number of validation issues found during template inspection.

`public bool CanBindTemplate { get; }` [#](#property-canbindtemplate)

[WordTemplatePreflightReport.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/07c6bff0a79428344663938dd8a3f4e85ca513a2/OfficeIMO.Word/WordTemplatePreflightReport.cs#L61)

True when no known issue prevents binding the template with the supplied data.

<!-- PowerForge markdown artifact sha256:999973DF7DDDAC822137828F217B1E43CB3D83D11F6B3599295A83B56A87054E -->
