Assembly.UseAnswerFile Method

This method creates an AnswerCollection object, loads the answers from the answerFilePath answer file into it, and sets the Assembly.AnswerCollection property to the object. This is just a shortcut method, as everything it does you could do manually by using other methods and properties.

Syntax

void UseAnswerFile ( string answerFilePath )

Parameters Description
answerFilePath File system path to an answer file.

Example

The following Visual C# example begins an assembly using a specific answer file:

public class ExampleCode
{
    static void Main()
    {
        HotDocs.Application app = new HotDocs.Application();
        HotDocs.Assembly asm = new HotDocs.Assembly();
         
        asm.TemplatePath = @"C:\temp\Demo Employment Agreement.docx";
        asm.UseAnswerFile(@"C:\temp\EmployeeAnswers.anx");
        asm.Visible = true;
        app.Assemblies.Add(asm);
    }
}