AnswerCollection.AddAnswer Method

This method creates a new Answer object and adds it to the AnswerCollection. If the answer already exists in the answer collection, its value will be replaced with the value in the VarValue parameter.

Syntax

void AddAnswer ( string VarName , HotDocs_Online.ansType VarType , object VarValue , int repeatIndex1 , int repeatIndex2 , int repeatIndex3 , int repeatIndex4 )

Parameters Description
VarName The name of the answer.
VarType An answer type from the ansType enumeration.
VarValue The value of the answer.
repeatIndex1 [optional] The first repeat index
repeatIndex2 [optional] The second repeat index
repeatIndex3 [optional] The third repeat index
repeatIndex4 [optional] The fourth repeat index

Example

'This example opens an answer file, adds two answers to it, then saves and closes it.
 
Dim ac
Set ac = Server.CreateObject("HotDocs_Online.AnswerCollection")
 
ac.Open "c:\answers\answers.ans"
 
ac.AddAnswer "First Name", 1, "Violet"
ac.AddAnswer "Last Name", 1, "Anderson"
 
ac.Save
ac.Close