AnswerCollection.Count Property

This property returns the number of Answer objects in the AnswerCollection .

Syntax

int Count [ get ]

Example

The following Visual C# example creates a new AnswerCollection object for a given answer file and displays the file name, format (type), title, description, and number of answers stored in the file:

public class ExampleCode
{
    static void Main()
    {
        HotDocs.AnswerCollection asc = new HotDocs.AnswerCollection();
         
        asc.Create(@"C:\Documents\HotDocs\Answers\AnswerFile.anx");
         
        Console.WriteLine("File: {0}\n", asc.FileName);
        Console.WriteLine("Format (Type): {0}\n", asc.FileFormat);
        Console.WriteLine("Title: {0}\n", asc.Title);
        Console.WriteLine("Description: {0}\n", asc.Description);
        Console.WriteLine("Count: {0}\n", asc.Count);
         
        asc.Close();
    }
}