HotDocs_Online.FileCollection Object
This object represents an ordered set of strings representing file paths. It is used to manipulate the assembly queue and the set of inserted files encountered during an assembly. For example, when a template is assembled that contains one or more ASSEMBLE instructions, the templates in those ASSEMBLE instructions are added to the assembly queue (Application.Assemblies).
For FileCollection objects that represent a list of templates waiting to be assembled, your host application can then iterate through the collection to assemble each template in the list. As each document is assembled, you could add the file names of the assembled documents to a separate FileCollection object. Finally, once all documents have been assembled, you could use the SaveAsZipFile method on that collection of assembled documents to package the documents into a single ZIP file, or you could use the Application.AppendDocumentFile method to append all of the assembled documents together to create one large document.
Interface Information
ProgID: | HotDocs_Online.FileCollection.10.1 |
Version Independent ProgID: | HotDocs_Online.FileCollection |
CLSID: | {4CFDF711-79D6-401E-AE92-9AE7DCBFCA93} |
_FileCollection Interface: | IID: {43A277DB-74B6-473F-9BDF-3F6B29338A36} |
_FileCollectionEvents Interface: | IID: {17B91800-A42F-4825-BB52-19A95588D3C4} |
Methods
Method | Description |
Add | This method adds a new file path to the FileCollection. |
Clear | This method removes all file names from the FileCollection. |
CopyFile | This method copies a file from one index in the FileCollection to another. The contents of the file at the second index (destindex) are replaced by the contents of the file at the first index (srcindex). |
CreateCollectionFromZipFile | This method extracts files from a .ZIP file and adds the file names (including file path) to the FileCollection. |
DeleteFile | This method deletes the specified file from disk. It does not remove the file name from the FileCollection, however. (To remove it from the collection, use the Remove method.) |
Insert | This method inserts a new file name (and path) to the FileCollection at a specific location. |
Item | This method returns the specified string from the collection. |
Move | This method moves a file name from one location to another within the FileCollection. |
PrependSafeArray | This method adds the contents of an array to the beginning of an existing FileCollection. This is useful when adding new entries to the assembly queue. |
Remove | This method removes a file name from the FileCollection. |
SaveAsZipFile | This method adds each file represented by a file name in the FileCollection to a .ZIP file. |
Properties
Property | Description |
AsSafeArray | [Read/Write] This property sets or returns the list of file names in the FileCollection a safe array. You can then add this array of file names to the beginning of another FileCollection object using the PrependSafeArray method. |
AsString | [Read/Write] This property sets or returns the list of file names in the FileCollection as a delimited string. This is useful for passing the contents of the collection across HTTP requests. |
Count | [Read-only] This property returns the number of file names in the FileCollection. |