HotDocs.Assembly Object

The Assembly object represents a HotDocs assembly. All HotDocs assemblies are represented by an Assembly object internally (with the exception of test assemblies). The Assembly object contains information about the inputs and outputs of the assembly, state information about how the assembly is performed, and features to customize and control the Assembly interface.

All assemblies are stored in a queue called the AssemblyCollection. The AssemblyCollectionis exposed through the API with the HotDocs.Application.Assemblies property. The queue is ordered so the items at the top of the collection will be processed before the assemblies at the bottom of the queue (such is the nature of queues).

When HotDocs begins an assembly, it doesn't remove the Assembly object from the queue. The object is still accessible from the HotDocs.Application.Assemblies property or through the HotDocs.Application.ActiveAssembly property. Be careful about accessing the currently assembling object however. By changing the state of the currently assembling Assembly object, you can put HotDocs into a bad state.

General Information

ProgID: HotDocs.Assembly.11.0
HotDocs.Assembly (version-independent)
CLSID: {503AB2B4-5D01-4EF0-9B2B-36E1B9C738A9}

The following table shows the name and IID for each interface, as well as the version of HotDocs in which it was introduced. The primary interface and the main public interface exposed by this object is _Assembly.

Name IID Added in
_Assembly {A99AB319-0378-4033-9534-DF296B6B63C6} Added in HotDocs 6.0
_Assembly2 {A99AB320-0378-4033-9534-DF296B6B63C6} Added in HotDocs 6.1 SP1
_Assembly3 {A99AB321-0378-4033-9534-DF296B6B63C6} Added in HotDocs 2005 SP2
_AssemblyEvents {58172076-C690-434D-942B-F3EA55693C98} Added in HotDocs 6.0

The _AssemblyEvents interface designates an event sink interface that an application must implement in order to receive event notifications from a HotDocs.Assembly object.

Methods

Method Description
AddUserMenuItem This method adds a custom menu item to the HotDocs assembly window menus.
DeleteUserMenuItem

 This method removes a custom menu item from the HotDocs assembly window menu that was created using the AddUserMenuItem method.

GetSaveAsExtDlg This method prompts the user for a file type to use when saving a document in a document manager.
LocalBrowseDlg This method displays a dialog box for the user to select a file.
OpenAnswerFileDlg This method displays the Open Answer File dialog box.
SelectOpenAnswerFileDlg This method displays the Open Answer File dialog box and returns the file name and path of the selected answer file.
SendToWordProcessor This method sends the resulting assembled document to the word processor.
SetUserInterfaceItem This method sets the state for the element user interface element. This method is useful to turn off features the users of your integration should not have access to and enable features users may have disabled.
UseAnswerFile 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.

Properties

Property Description
AnswerCollection [Read/Write] This property controls the AnswerCollection object used during assembly. The value of this property is a reference to the AnswerCollection object used by the Assembly object.
AnswerSummaryPath [Read/Write] This property controls the location to which the answer summary file is written. If this property is set when the assembly starts, an Answer Summary will be written in the specified location when the assembly is complete.
Application [Read-only] This property returns a reference to the Application object.
AssemblyHandle [Read-only] This property reports the handle that can identify the assembly. This value is the same as the assembly handle returned when the Assembly was added to the assembly queue.
CommandLine [Write-only] This property sets command line options for the assembly as if it were started with a particular command line from the library. Setting this property to a string is the same as if the string were passed in from the library entry.
DocumentPath [Read/Write] This property controls the location where the assembled document file is written. It is the file path for the destination file.
Hwnd [Read-only] This property returns the window handle for the HotDocs Assembly interface.
KeepInQueue [Read/Write] This Boolean property controls the behavior of the assembly queue. If it is TRUE when the assembly is complete, a reference will remain in the Assembly Queue window. If it is FALSE, all references to the assembly will be destroyed when the assembly is complete.
Map [Read/Write] This property controls which VarMap object is used during assembly.
PrintWhenComplete [Read/Write] This Boolean property controls whether the document is automatically printed when the assembly completes. It controls the same behavior as specifying a Print (/pr) option at the command line.
PromptToSaveDocument [Read/Write] This is a Boolean property that controls whether HotDocs will prompt to save a copy of the assembled document at the end of the assembly. The initial value is the value stored in the Document Assembly folder in HotDocs Options (Tools > Options > Document Assembly > Prompt to save document when closing assembly window). If the integrator changes the PromptToSaveDocument property, HotDocs will disregard the setting in HotDocs Options in favor of the value set in the integration.
QuestionSummaryPath [Read/Write] This property controls the location to which the question summary file is written. If this property is set when the assembly starts, a question summary will be written out as an HTML document when the assembly is complete.
ShowAnswerFileDialog [Read/Write] This Boolean property controls whether or not the Save Answers dialog box appears at the end of an assembly.
Status [Read-only] This property tells what state the Assembly object is in.
SuppressUnansweredWarning [Read/Write] This is a Boolean property that sets the Display unanswered warning before saving documents option for the given assembly. If this property is false, then HotDocs will display a warning before the user saves the document or sends the document to the word processor if there are variables which are used but not answered. If this property is true, then all such warnings are suppressed.
TemplateDesc [Read/Write] This property contains the description for the template that will be used to assemble a document. This property is for the integration programmer's convenience. It is set but is not used by HotDocs internally.
TemplatePath [Read/Write] This property contains the file system path for the template that will be used to assemble a document.
TemplateTitle [Read/Write] This property contains the title for the template that will be used to assemble a document.
Visible [Read/Write] This Boolean property determines if the assembly interface will be visible to the user. This property must be set before assembly starts or it will have no effect. If Visible returns false, then it has the same effect as specifying the No Assembly Window (/nw) option on the command line.

Events

Event Description
OnAssemblyCompleteEvent This event is fired when the assembly completes.
OnAssemblyStartEvent This event is fired when the assembly starts.
OnCanOpenFile This event is fired when a file can be opened.
OnCloseAssemblyInterfaceEvent This event is fired when assembly interface actually closes.
OnErrorEvent This event is fired when an error occurs. By returning true for the override parameter, the integration can tell HotDocs not to display any error messages, allowing the integration to either display its own error message or deal with the error silently.
OnFileOpen This event is fired when a file is opened.
OnFileSave This event is fired when a file is saved.
OnFileSelectEvent This event is fired when a file is selected.
OnGetAnswerFileDisplayName This event is fired when HotDocs gets the name of an answer file to display.
OnGetMRUInfo This event is fired when HotDocs gets information from the most recently used (MRU) list.
OnNeedAnswerEvent This event is fired when an answer value is needed by the assembly, but not found in the AnswerCollection answer set. It allows the integration to provide answers as they are needed, rather than trying to provide all the answers before the assembly starts.
OnPostCloseAnswerFile This event is fired after the answer file is closed.
OnPostSaveDocumentEvent This event is fired after a document is saved. The document can be an assembled document, a question summary document, or an answer summary document.
OnPreCloseAnswerFile This event is fired when HotDocs prepares to close an answer file.
OnPreSaveDocumentEvent This event is fired prior to saving the document. By setting *showui = false, the integration can prevent the user interface relating to saving the document from showing. By setting *override = true, the integration can prevent the save from happening.
OnUserInterfaceEvent This event is fired when the user selects certain options at the assembly interface. This can be useful if the integration wants to override a particular HotDocs feature or command.
OnUserMenuItemClickedEvent This event is fired when the user selects an integration-defined menu item. (See Assembly.AddUserMenuItem method.)
PostSaveAnswersEvent This event is fired after an answer file is saved.
PreSaveAnswersEvent This event is fired after the user has indicated he or she wants to save the answers, but before the actual save occurs. By setting *override == true, the integration can prevent the save from happening.