OdsoRecipientDataCollection class

A typed collection of OdsoRecipientData

public class OdsoRecipientDataCollection : IEnumerable<OdsoRecipientData>


Name Description
OdsoRecipientDataCollection() The default constructor.


Name Description
Count { get; } Gets the number of elements contained in the collection.
Item { get; set; } Gets or sets an item in this collection.


Name Description
Add(OdsoRecipientData) Adds an object to the end of this collection.
Clear() Removes all elements from this collection.
GetEnumerator() Returns an enumerator object that can be used to iterate over all items in the collection.
RemoveAt(int) Removes the element at the specified index.


Shows how to access the collection of data that designates which merge data source records a mail merge will exclude.

Document doc = new Document(MyDir + "Odso data.docx");

OdsoRecipientDataCollection dataCollection = doc.MailMergeSettings.Odso.RecipientDatas;

Assert.AreEqual(70, dataCollection.Count);

using (IEnumerator<OdsoRecipientData> enumerator = dataCollection.GetEnumerator())
    int index = 0;
    while (enumerator.MoveNext())
            $"Odso recipient data index {index++} will {(enumerator.Current.Active ? "" : "not ")}be imported upon mail merge.");
        Console.WriteLine($"\tColumn #{enumerator.Current.Column}");
        Console.WriteLine($"\tHash code: {enumerator.Current.Hash}");
        Console.WriteLine($"\tContents array length: {enumerator.Current.UniqueTag.Length}");

// We can clone the elements in this collection.
Assert.AreNotEqual(dataCollection[0], dataCollection[0].Clone());

// We can also remove elements individually, or clear the entire collection at once.

Assert.AreEqual(69, dataCollection.Count);


Assert.AreEqual(0, dataCollection.Count);

See Also