ComponentCollection.Create Method

This method creates a new, empty component file. For example, you may want to create a new component file so you can seed it with data (variables) that correspond to your integrating application. If filePath refers to a file that already exists, an error is returned.

This method was introduced with the release of HotDocs 6.1.

Syntax

void Create ( string filePath )

Parameters Description
filePath The file system path of the new component file.

Example

The following Visual C# example creates a new component file and creates nine Text variables in it.

public class ExampleCode
{
    static void Main()
    {
        HotDocs.ComponentCollection ccl = new HotDocs.ComponentCollection();
         
        ccl.Create(@"C:\temp\Createdfile.cmp");
        for (int i = 1; i < 10; i++)
        ccl.CreateVariable("Variable " + i.ToString(),HotDocs.HDVARTYPE.HD_TEXTTYPE, "Prompt for Variable " + i.ToString());
    }
}