MailMerge module

class MailMerge.MailMerge

Bases: SpireObject

Represents a mail merge operation.

property ClearFields: bool

Gets or sets a value indicating whether to clear the fields. By default, the value is True.

Returns:

True if it clears the fields, False otherwise.

Return type:

bool

property ClearGroupTag: bool

Gets or sets a value indicating whether to clear the group tag. By default, the value is False.

Returns:

True if it clears the group tag, False otherwise.

Return type:

bool

Execute
ExecuteGroup(dataSource: MailMergeDataTable)

Executes the mail merge operation for a group in the data source.

Parameters:

dataSource (MailMergeDataTable) – The data source for the mail merge operation.

ExecuteWidthNestedRegion
<summary>

Executes the nested region.

</summary>

GetMergeFieldNames

Returns a collection of mergefield names found in the document.

GetMergeGroupNames() List[str]

Gets the merge field names.

property HideEmptyGroup: bool

Gets or sets a value indicating whether to remove groups which contain empty merge fields

property HideEmptyParagraphs: bool

Gets or sets a value indicating whether to remove paragraphs which contain empty merge fields.

Returns:

True to remove paragraphs with empty merge fields, False otherwise.

Return type:

bool

property MailMergeMainDocumentType: MailMergeMainDocumentType

Gets or sets the type of the main document for the mail merge operation.

Returns:

The type of the main document.

Return type:

MailMergeMainDocumentType

add_MergeField(value: MergeFieldEventHandler)
add_MergeGroup(value: MergeGroupEventHandler)
add_MergeImageField(value: MergeImageFieldEventHandler)
remove_MergeField(value: MergeFieldEventHandler)
remove_MergeGroup(value: MergeGroupEventHandler)
remove_MergeImageField(value: MergeImageFieldEventHandler)