HotDocs_Online.AnswerCollection Object

An AnswerCollection is a group of Answer objects, which HotDocs Server uses when it assembles a document. Each Answer in the collection represents a different HotDocs variable, each of which may contain one or more values. For example, the Answer for a variable in a dialog that is repeated five times would contain five values. During document assembly, HotDocs replaces variable fields in the template with corresponding answers from the AnswerCollection.

AnswerCollection objects may be saved on disk as HotDocs answer files; likewise, you can open an existing answer file and read its answers to populate a new AnswerCollection.

An answer file contains the answers entered during an interview. It can be used to assemble other documents that require the same information.

Interface Information

ProgID: HotDocs_Online.AnswerCollection.10.1
Version Independent ProgID: HotDocs_Online.AnswerCollection
CLSID: {E6ADBFAB-C9A7-435D-9CD6-EDE8BD4AA293}
_AnswerCollection Interface: IID: {A9BED2DF-BAE7-4BF9-93D4-E944E81A6F8E}
_AnswerCollection2 Interface: IID: {A9BED2DE-BAE7-4BF9-93D4-E944E81A6F8E}
_AnswerCollection3 Interface:

IID: {A9BED2DD-BAE7-4BF9-93D4-E944E81A6F8E}

Default interface.

_AnswerCollectionEvents Interface: IID: {1E46DF1C-06B2-4FE2-A13C-F00BDA8E6BC7}

Methods

Method Description
AddAnswer This method creates a new Answer object and adds it to the AnswerCollection. If the answer already exists in the answer collection, its value will be replaced with the value in the VarValue parameter.
Clear This method removes all answers from the AnswerCollection.
Close This method closes an answer file that has been opened using the Open method, which frees all of the resources associated with an AnswerCollection object.
GetRptCount This method gets the number for each repeat and any nested repeats.
GetXMLAnswers This method retrieves the XML representation of an answer set.
Item This method retrieves an Answer object from the AnswerCollection object.
Open This method opens an existing answer file and populates the AnswerCollection. If the answer file does not exist, however, this method will return an error.
OverlayAnswerFile This method loads answers from the specified answer file into the current answer collection.
OverlayXMLAnswers This method overlays answers contained in the XML string (e.g., from a browser-based interview) into the current answer set.
Remove This method removes an answer from the AnswerCollection.
Save This method saves the answer collection. If you are creating an answer file, you can specify a location on the disk to save it to and use the FileFormat property to specify the type of answer file (either .ANS or .ANX). If you are using a pre-existing answer file, it will save any changes to the file to the location where the answer file resides.
SetUploadedAnswers This method populates an AnswerCollection object with answers posted from a desktop version of HotDocs. In desktop HotDocs, you can specify a component file property that allows answers from an offline interview to be uploaded to a server. The SetUploadedAnswers method accepts these answers, parses them, and populates the answer collection with the results. The first parameter is a variant. It contains a SAFEARRAY of the posted data. This can be obtained in an ASP by a call to Request.BinaryRead. The second parameter (size) is a number which indicates the size (number of bytes) of the SAFEARRAY. There is an extra answer added to the answer collection which indicates the name of the assembled document. The name of the answer is _template_. Querying the answer collection for this answer will return the name of the template given in the Answer History portion of the posted answers.
SetXMLAnswers This method populates the AnswerCollection object with an XML string that conforms to the HotDocs Server answer DTD.
ValidateXMLAnswerFile This method loads an XML file and verifies that it conforms to the HotDocs ANX DTD by returning a Boolean value. For example, you can use this method to verify that an XML document is constructed correctly to be used as an XML answer set. It is very similar to ValidateXMLAnswerSet.
ValidateXMLAnswerSet This method loads an XML document and verifies that it conforms to the HotDocs ANX DTD by returning a Boolean value. For example, you can use this method to verify that an XML document is constructed correctly to be used as an XML answer set. It is very similar to ValidateXMLAnswerFile.

Properties

Property Description
ACHandle [Read-only] This property returns a number that identifies the AnswerCollection.
Count [Read-only] This property returns the number of answered variables in an answer collection. Repeat variables are indexed only once.
FileFormat [Read/Write] This property sets or returns the answer file format value. The value comes from the ansFileformat enumeration.
fileName [Read-only] This property specifies the file name of the AnswerCollection.