MailMergeOptions.RestartListsAtEachSection

MailMergeOptions RestartListsAtEachSection property. Gets or sets a value indicating whether lists are restarted at each section after executing of a mail merge.

MailMergeOptions.RestartListsAtEachSection property

Gets or sets a value indicating whether lists are restarted at each section after executing of a mail merge.

public bool RestartListsAtEachSection { get; set; }

Remarks

The default value is true.

Examples

Shows how to restart list numbering in each section after executing simple mail merge.

DataTable dt = new DataTable();
dt.Columns.Add("FirstName");
dt.Columns.Add("LastName");
dt.Rows.Add("James", "Bond");
dt.Rows.Add("John", "Doe");

MailMergeOptions mailMergeOptions = new MailMergeOptions();
mailMergeOptions.RestartListsAtEachSection = true;

MailMerger.Execute(MyDir + "MailMergeTemplate.RestartListsAtEachSection.docx",
    ArtifactsDir + "MailMerge.RestartListsAtEachSection.docx",
    SaveFormat.Docx,
    dt,
    mailMergeOptions);

See Also