Answer.Create Method

This method creates a new HotDocs answer.

Syntax

void Create ( string ansName, HotDocs.HDVARTYPE valType)

Parameter Description
ansName The name of the variable for this answer.
valType The variable type for this answer. This can be one of the following values from the HDVARTYPE enumeration:
  • HD_TEXTTYPE
  • HD_NUMBERTYPE
  • HD_DATETYPE
  • HD_TRUEFALSETYPE
  • HD_MULTCHOICETYPE

Example

The following Visual C# example creates a new answer, assigns it a value, and adds it to an answer file:

public class ExampleCode
{
    static void Main()
    {
        HotDocs.AnswerCollection asc = new HotDocs.AnswerCollection();
        HotDocs.Answer ans = new HotDocs.Answer();
         
        asc.Create(@"C:\Documents\HotDocs\Answers\AnswerFile.anx"); 
        ans.Create("Employee Name", HotDocs.HDVARTYPE.HD_TEXTTYPE);
        ans.Value = "John Simpson";
        asc.Add(ans);
        asc.Save(@"C:\Documents\HotDocs\Answers\AnswerFile.anx");
          
        asc.Close();
    }
}