ComponentCollection.Item Method

This method retrieves a Component object from a ComponentCollection.

Syntax

HotDocs._Component Item ( object index, ref HotDocs.HDVARTYPE varType )

Parameters Description
index This parameter can be either a number or a string. If it is a number, it represents the position of the desired Component object in the collection. If it is a string, it represents the variable name of the desired Component object. Since HotDocs variables are identified by name and type, the second parameter, vartype, must be set to the correct HDVARTYPE value when calling this method with a string for the index parameter.

If the ComponentCollection.OnlyVariables property is true, a numerical index can only access components that are Text, Number, Date, True/False, and Multiple Choice variables. If you want to access other component types with a numerical index, set OnlyVariables to false.

vartype [optional] When the index parameter is a number, this parameter returns the correct HDVARTYPE for the retrieved Component object. When the index parameter is a string, this parameter must be the HDVARTYPE for the component with that variable name.

Return Value

The Component object requested.