AnswerCollection.FileName Property

[Read-only] This property returns the file name of the answer file represented by the AnswerCollection object. To specify the file path for the answer file, pass the file path and name to either the Create or Save method.

Syntax

string FileName [ 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();
    }
}