This method adds an additional value to a particular Multiple Choice answer iteration.
Only Multiple Choice variables specified as Select All That Apply will accept multiple values for the same repeat iteration.
void AddMultipleChoiceValue ( string newValue)
Parameter | Description |
newValue | The option text for the newly-selected option. If this text is not one of the option text values in the component file, the value will be stored in the answer file, but it will never be used because only values in the component file are valid options. |
The following Visual C# example adds additional values to a Multiple Choice answer and displays a message box with all answers for the variable:
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"); HotDocs.HDVARTYPE vType = HotDocs.HDVARTYPE.HD_MULTCHOICETYPE; ans = asc.Item("Company Representative", ref vType); ans.AddMultipleChoiceValue("Ed Hall"); ans.AddMultipleChoiceValue("Kim Schuster"); object[] vals = (object[])ans.Value; string msg = ""; for (int i = 0; i < vals.Length; i++) { msg = msg + vals[i].ToString() + "\r\n"; } MessageBox.Show(msg); asc.Save(@"C:\Documents\HotDocs\Answers\AnswerFile.anx"); asc.Close(); } }