Class MailMerger
Namespace: Aspose.Words.LowCode
Assembly: Aspose.Words.dll (25.2.0)
Provides methods intended to fill template with data using simple mail merge and mail merge with regions operations.
public static class MailMerger
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
Execute(string, string, string[], object[])
Performs a mail merge operation for a single record.
public static void Execute(string inputFileName, string outputFileName, string[] fieldNames, object[] fieldValues)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
fieldNames
string[]
Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
fieldValues
object[]
Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames.
Execute(string, string, SaveFormat, string[], object[])
Performs a mail merge operation for a single record.
public static void Execute(string inputFileName, string outputFileName, SaveFormat saveFormat, string[] fieldNames, object[] fieldValues)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
fieldNames
string[]
Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
fieldValues
object[]
Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames.
Execute(string, string, SaveFormat, MailMergeOptions, string[], object[])
Performs a mail merge operation for a single record.
public static void Execute(string inputFileName, string outputFileName, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, string[] fieldNames, object[] fieldValues)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
fieldNames
string[]
Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
fieldValues
object[]
Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames.
Execute(string, string, SaveOptions, MailMergeOptions, string[], object[])
Performs a mail merge operation for a single record.
public static void Execute(string inputFileName, string outputFileName, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, string[] fieldNames, object[] fieldValues)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
fieldNames
string[]
Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
fieldValues
object[]
Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames.
Execute(Stream, Stream, SaveFormat, string[], object[])
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveFormat saveFormat, string[] fieldNames, object[] fieldValues)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
fieldNames
string[]
Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
fieldValues
object[]
Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames.
Execute(Stream, Stream, SaveFormat, MailMergeOptions, string[], object[])
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, string[] fieldNames, object[] fieldValues)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
fieldNames
string[]
Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
fieldValues
object[]
Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames.
Execute(Stream, Stream, SaveOptions, MailMergeOptions, string[], object[])
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, string[] fieldNames, object[] fieldValues)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
fieldNames
string[]
Array of merge field names. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
fieldValues
object[]
Array of values to be inserted into the merge fields. Number of elements in this array must be the same as the number of elements in fieldNames.
Execute(string, string, DataRow)
Performs mail merge from a DataRow into the document.
public static void Execute(string inputFileName, string outputFileName, DataRow dataRow)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
dataRow
DataRow
Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(string, string, SaveFormat, DataRow)
Performs mail merge from a DataRow into the document.
public static void Execute(string inputFileName, string outputFileName, SaveFormat saveFormat, DataRow dataRow)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
dataRow
DataRow
Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(string, string, SaveFormat, MailMergeOptions, DataRow)
Performs mail merge from a DataRow into the document.
public static void Execute(string inputFileName, string outputFileName, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataRow dataRow)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataRow
DataRow
Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(string, string, SaveOptions, MailMergeOptions, DataRow)
Performs mail merge from a DataRow into the document.
public static void Execute(string inputFileName, string outputFileName, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataRow dataRow)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataRow
DataRow
Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(Stream, Stream, SaveFormat, DataRow)
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveFormat saveFormat, DataRow dataRow)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
dataRow
DataRow
Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(Stream, Stream, SaveFormat, MailMergeOptions, DataRow)
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataRow dataRow)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataRow
DataRow
Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(Stream, Stream, SaveOptions, MailMergeOptions, DataRow)
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataRow dataRow)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataRow
DataRow
Row that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(string, string, DataTable)
Performs mail merge from a DataTable into the document.
public static void Execute(string inputFileName, string outputFileName, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(string, string, SaveFormat, DataTable)
Performs mail merge from a DataRow into the document.
public static void Execute(string inputFileName, string outputFileName, SaveFormat saveFormat, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(string, string, SaveFormat, MailMergeOptions, DataTable)
Performs mail merge from a DataRow into the document.
public static void Execute(string inputFileName, string outputFileName, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(string, string, SaveOptions, MailMergeOptions, DataTable)
Performs mail merge from a DataRow into the document.
public static void Execute(string inputFileName, string outputFileName, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(Stream, Stream, SaveFormat, DataTable)
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveFormat saveFormat, DataTable dataTable)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(Stream, Stream, SaveFormat, MailMergeOptions, DataTable)
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
Execute(Stream, Stream, SaveOptions, MailMergeOptions, DataTable)
Performs a mail merge operation for a single record.
public static void Execute(Stream inputStream, Stream outputStream, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
ExecuteWithRegions(string, string, DataTable)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
dataTable
DataTable
Data source for the mail merge operation. The table must have its TableName property set.
ExecuteWithRegions(string, string, SaveFormat, DataTable)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, SaveFormat saveFormat, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
ExecuteWithRegions(string, string, SaveFormat, MailMergeOptions, DataTable)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
ExecuteWithRegions(string, string, SaveOptions, MailMergeOptions, DataTable)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
ExecuteWithRegions(Stream, Stream, SaveFormat, DataTable)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(Stream inputStream, Stream outputStream, SaveFormat saveFormat, DataTable dataTable)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
ExecuteWithRegions(Stream, Stream, SaveFormat, MailMergeOptions, DataTable)
Performs a mail merge operation for a single record.
public static void ExecuteWithRegions(Stream inputStream, Stream outputStream, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
ExecuteWithRegions(Stream, Stream, SaveOptions, MailMergeOptions, DataTable)
Performs a mail merge operation for a single record.
public static void ExecuteWithRegions(Stream inputStream, Stream outputStream, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataTable dataTable)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataTable
DataTable
Table that contains data to be inserted into mail merge fields. Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored.
ExecuteWithRegions(string, string, DataSet)
Performs mail merge from a DataSet into a document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, DataSet dataSet)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
dataSet
DataSet
DataSet that contains data to be inserted into mail merge fields.
ExecuteWithRegions(string, string, SaveFormat, DataSet)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, SaveFormat saveFormat, DataSet dataSet)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
dataSet
DataSet
DataSet that contains data to be inserted into mail merge fields.
ExecuteWithRegions(string, string, SaveFormat, MailMergeOptions, DataSet)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataSet dataSet)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataSet
DataSet
DataSet that contains data to be inserted into mail merge fields.
ExecuteWithRegions(string, string, SaveOptions, MailMergeOptions, DataSet)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(string inputFileName, string outputFileName, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataSet dataSet)
Parameters
inputFileName
string
The input file name.
outputFileName
string
The output file name.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataSet
DataSet
DataSet that contains data to be inserted into mail merge fields.
ExecuteWithRegions(Stream, Stream, SaveFormat, DataSet)
Performs mail merge from a DataTable into the document with mail merge regions.
public static void ExecuteWithRegions(Stream inputStream, Stream outputStream, SaveFormat saveFormat, DataSet dataSet)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
dataSet
DataSet
DataSet that contains data to be inserted into mail merge fields.
ExecuteWithRegions(Stream, Stream, SaveFormat, MailMergeOptions, DataSet)
Performs a mail merge operation for a single record.
public static void ExecuteWithRegions(Stream inputStream, Stream outputStream, SaveFormat saveFormat, MailMergeOptions mailMergeOptions, DataSet dataSet)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveFormat
SaveFormat
The output’s save format.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataSet
DataSet
DataSet that contains data to be inserted into mail merge fields.
ExecuteWithRegions(Stream, Stream, SaveOptions, MailMergeOptions, DataSet)
Performs a mail merge operation for a single record.
public static void ExecuteWithRegions(Stream inputStream, Stream outputStream, SaveOptions saveOptions, MailMergeOptions mailMergeOptions, DataSet dataSet)
Parameters
inputStream
Stream
The input file stream.
outputStream
Stream
The output file stream.
saveOptions
SaveOptions
The output’s save options.
mailMergeOptions
MailMergeOptions
Mail merge options.
dataSet
DataSet
DataSet that contains data to be inserted into mail merge fields.