void Save ( string answerFileName )
Parameters | Description |
answerFileName | [optional] The path and file name for the resulting answer file. If the answer file already exists, it will be overwritten. If the file name was passed into the Create method, this parameter is not necessary. |
The following Visual C# example adds two answers to an answer file, then saves and closes it.
public class ExampleCode { static void Main() { HotDocs.AnswerCollection ac = new HotDocs.AnswerCollection(); HotDocs.Answer ans; ac.Create(@"C:\Documents\HotDocs\Answers\AnswerFile.anx"); ans = new HotDocs.Answer(); ans.Create("Agreement Date", HotDocs.HDVARTYPE.HD_DATETYPE); ans.Value = "01/01/2009"; ac.Add(ans); ans = new HotDocs.Answer(); ans.Create("Company Representative", HotDocs.HDVARTYPE.HD_MULTCHOICETYPE); ans.Value = "Stephanie Walker"; ac.Add(ans); ans = null; ac.Save(@"C:\Documents\HotDocs\Answers\AnswerFile.anx"); ac.Close(); } }