VariableCollection.Open Method

This method opens the template manifest (.manifest.xml) or variable collection (.HVC) file and populates the variable collection object. (You must use this method first if you plan to use the VariableCollection object.)

Syntax

public void Open ( string filePath )

Parameter Description
filePath The file name and path of a variable collection to open. This must be either a template manifest (.manifest.xml) or a legacy HotDocs Variable Collection (.HVC) file.

Example

The following C# sample code displays information about the VariableCollection:

public class ExampleCode
{
    static void Main()
    {
        HotDocs.Server.VariableCollection hvc = new HotDocs.Server.VariableCollection("C:\\Templates\\MyFile.rtf.manifest.xml");
        System.Console.WriteLine("VARIABLECOLLECTION OBJECT: --------------------------------------");
        System.Console.WriteLine(" {0}: {1}","Count", hvc.Count);
        System.Console.WriteLine(" {0}: {1}","Description", hvc.Description);
        System.Console.WriteLine(" {0}: {1}","Title", hvc.Title);
        for (int i=0;i<hvc.Count;i++)
            System.Console.WriteLine(" {0}: {1} ({2})",hvc.VarType(i).ToString(), hvc.VarName(i),hvc.VarEncodedName(i));
        hvc.Dispose();
    }
}