OdsoFieldMapDataCollection Class

A typed collection of the OdsoFieldMapData objects.
Inheritance Hierarchy
SystemObject
  Aspose.Words.SettingsOdsoFieldMapDataCollection

Namespace:  Aspose.Words.Settings
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public class OdsoFieldMapDataCollection : IEnumerable<OdsoFieldMapData>, 
	IEnumerable

The OdsoFieldMapDataCollection type exposes the following members.

Constructors
  NameDescription
Public methodOdsoFieldMapDataCollection
Initializes a new instance of the OdsoFieldMapDataCollection class
Properties
  NameDescription
Public propertyCode exampleCount
Gets the number of elements contained in the collection.
Public propertyCode exampleItem
Gets or sets an item in this collection.
Methods
  NameDescription
Public methodCode exampleAdd
Adds an object to the end of this collection.
Public methodCode exampleClear
Removes all elements from this collection.
Public methodEquals (Inherited from Object.)
Public methodCode exampleGetEnumerator
Returns an enumerator object that can be used to iterate over all items in the collection.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodCode exampleRemoveAt
Removes the element at the specified index.
Public methodToString (Inherited from Object.)
Remarks
Examples
Shows how to access the collection of data that maps data source columns to merge fields.
Document doc = new Document(MyDir + "Odso data.docx");

// This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD,
// ADDRESSBLOCK and GREETINGLINE fields during a mail merge
OdsoFieldMapDataCollection fieldMapDataCollection = doc.MailMergeSettings.Odso.FieldMapDatas;

Assert.AreEqual(30, fieldMapDataCollection.Count);
int index = 0;

foreach (OdsoFieldMapData data in fieldMapDataCollection)
{
    Console.WriteLine($"Field map data index #{index++}, type \"{data.Type}\":");

    Console.WriteLine(
        data.Type != OdsoFieldMappingType.Null
            ? $"\tColumn named {data.Name}, number {data.Column} in the data source mapped to merge field named {data.MappedName}."
            : "\tNo valid column to field mapping data present.");

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