ListEntry (object)

<< Click to Display Table of Contents >>

ListEntry (object)

Access paths:

Application à Documents à Item à FormFields à Item à DropDown à ListEntries à Item

Application à ActiveDocument à FormFields à Item à DropDown à ListEntries à Item

 1  Description

A ListEntry object represents one individual entry in a drop-down list (a form object) and allows you to retrieve, change and delete it.

An individual ListEntry object exists for each entry in a drop-down list. If you add entries to a drop-down list or delete them, the respective ListEntry objects will be created or deleted dynamically.

 2  Access to the object

The individual ListEntry objects can be accessed solely through enumerating the elements of the collection ListEntries. Each selection list has exactly one instance of this collection.

An example:

' Show an entry from the first form field in the document (a drop-down list)

MsgBox tm.ActiveDocument.FormFields(1).DropDown.ListEntries.Item(1).Name

 3  Properties, objects, collections and methods

Properties:

Name (default property)

 

Objects:

Application Application

Parent ListEntries

 

Methods:

Delete

Name (property)

Data type: String

Gets or sets the content of the ListEntry object – in other words: the content of the respective list entry.

Examples:

' Show the first list entry

MsgBox tm.ActiveDocument.FormFields(1).DropDown.ListEntries.Item(1).Name

 

' Set a new value for the first list entry

tm.ActiveDocument.FormFields(1).DropDown.ListEntries.Item(1).Name = "Green"

Note: You can use this method to replace the text only in already existing list entries. If you want to add new entries to the list, use the method Add from the ListEntries collection.

Application (pointer to object)

Data type: Object

Returns the Application object.

Parent (pointer to object)

Data type: Object

Returns the parent object, i.e. an object of the type ListEntries.

Delete (method)

Deletes the ListEntry object from the parent ListEntries collection.

Syntax:

 Delete

Parameters:

none

Return type:

none

Example:

' Delete the first list entry

tm.ActiveDocument.FormFields(1).DropDown.ListEntries.Item(1).Delete