OdsoRecipientDataCollectionAdd Method

Adds an object to the end of this collection.

Namespace:  Aspose.Words.Settings
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public int Add(
	OdsoRecipientData value
)

Parameters

value
Type: Aspose.Words.SettingsOdsoRecipientData
The object to add. Cannot be null.

Return Value

Type: Int32
Examples
Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(MyDir + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection odsoRecipientDataCollection = doc.MailMergeSettings.Odso.RecipientDatas;

Assert.AreEqual(70, odsoRecipientDataCollection.Count);
int index = 0;

foreach (OdsoRecipientData data in odsoRecipientDataCollection)
{
    Console.WriteLine($"Odso recipient data index #{index++}, will {(data.Active ? "" : "not ")}be imported upon mail merge.");
    Console.WriteLine($"\tColumn #{data.Column}");
    Console.WriteLine($"\tHash code: {data.Hash}");
    Console.WriteLine($"\tContents array length: {data.UniqueTag.Length}");

    Assert.AreNotEqual(data, data.Clone());
}
See Also