OdsoRecipientData Class

Represents information about a single record within an external data source that is to be excluded from the mail merge.
Inheritance Hierarchy
SystemObject
  Aspose.Words.SettingsOdsoRecipientData

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

The OdsoRecipientData type exposes the following members.

Constructors
  NameDescription
Public methodOdsoRecipientData
Initializes a new instance of the OdsoRecipientData class
Properties
  NameDescription
Public propertyCode exampleActive
Specifies whether the record from the data source shall be imported into a document when the mail merge is performed. The default value is true.
Public propertyCode exampleColumn
Specifies the column within the data source that contains unique data for the current record. The default value is 0.
Public propertyCode exampleHash
Represents the hash code for this record. Sometimes Microsoft Word uses Hash of a whole record instead of a UniqueTag value. The default value is 0.
Public propertyCode exampleUniqueTag
Specifies the contents of a given record in the column containing unique data. The default value is null.
Methods
  NameDescription
Public methodCode exampleClone
Returns a deep clone of this object.
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks

If a record shall be merged into a merged document, then no information is needed about that record. However, if a given record shall not be merged into a merged document, then the value of the unique key for that record shall be stored in the UniqueTag property of this object to indicate this exclusion.

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