OdsoRecipientDataCollection class

OdsoRecipientDataCollection class

A typed collection of OdsoRecipientData To learn more, visit the Mail Merge and Reporting documentation article.

Remarks

Constructors

NameDescription
OdsoRecipientDataCollection()The default constructor.

Indexers

NameDescription
__getitem__(index)Gets or sets an item in this collection.

Properties

NameDescription
countGets the number of elements contained in the collection.

Methods

NameDescription
add(value)Adds an object to the end of this collection.
clear()Removes all elements from this collection.
remove_at(index)Removes the element at the specified index.

Examples

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

doc = aw.Document(MY_DIR + "Odso data.docx")

data_collection = doc.mail_merge_settings.odso.recipient_datas

self.assertEqual(70, data_collection.count)

for index, data in enumerate(data_collection):
    print(f'Odso recipient data index {index} will {"" if data.active else "not "}be imported upon mail merge.')
    print(f"\tColumn #{data.column}")
    print(f"\tHash code: {data.hash}")
    print(f"\tContents array length: {data.unique_tag.length}")

# We can clone the elements in this collection.
self.assertNotEqual(data_collection[0], data_collection[0].clone())

# We can also remove elements individually, or clear the entire collection at once.
data_collection.remove_at(0)

self.assertEqual(69, data_collection.count)

data_collection.clear()

self.assertEqual(0, data_collection.count)

See Also