Collections
All collections in the object model support the following methods:
Instead of the
Item method, you can address collection items using parentheses or square brackets. The available syntax depends on the language:
For example, use
Items( 1 ).Text = "Hello" or Items[ 1 ].Text = "Hello". All collections work in for each and similar constructs.
Recurring fields and tables
All document fields except tables can be recurring. In the document structure, a special prototype field represents each recurring field. This prototype field has a nonemptyItems collection.
A prototype field has neither child items nor a value. It only stores the field’s iterations. Child fields and field values exist only on the field instances, which you access through the Items method of the IField object.
Tables always have the Rows collection (Rows is a synonym for Items). The Rows collection contains only the table rows whose cells you can access through the Children method of the rows.
Field paths
TheField, HasField, and IndexedItemValue methods of the IDocument object take paths to the fields on the form as their parameters. The following Backus-Naur Form (BNF) defines the path syntax:
Field_name indicates the names of the document fields as defined in the Document Definition, and Field_iteration_number is the iteration number of the recurring field (the row number for tables) starting from 0.
The path can be full or relative. A full path starts with the name of the document section. A relative path starts with the name of the child item in the group.
For example, to address the third row of the column Total in the table Table, located in the section Section, write "Section\Table[2]\Total". You can construct this full name with the FullName method of the IField object.