How do I create a new HotDocs Map (.HMF) file?

To create a new HotDocs Map (.HMF) file

  1. Use the COM API to create a new VarMap object.
  2. Populate the HDVariables collection using one (or both) of the following methods:
  3. Populate the SourceNames collection (a list of the fields in your application's data source that you want to make available for mapping) using the VarMap.SourceNamesAdd or VarMap.SourceNamesAdd2 methods.
  4. Populate the Mapping collection (a list of mappings between variables and data sources) using the VarMap.MappingAdd, VarMap.MappingAdd2, or VarMap.MappingaddEx2 methods.
  5. Manipulate the contents of the mapping collection, including adding, removing, or editing associations within the mapping.
  6. Optionally, use the VarMap.ShowUserInterface method to display the mapping interface so users can make changes to the associations.
  7. Use the VarMap.SaveMapFile method to save the specified associations as a HotDocs Map (.HMF) file.

If you want to base the new mapping file on an existing file, you can also use the VarMap.OpenMapFile method to populate the HDVariables, SourceNames, and Mapping collections.

Example

The following Visual C# example shows how you can create a new HotDocs Map file:

string cmpFile = @"c:\temp\SampleFile.cmp";

string mapFile = @"c:\temp\SampleFile.hmf";

 

//Create a new VarMap object

HotDocs.VarMap vmap = new HotDocs.VarMap();

 

//Populate the HDVariables collection.

vmap.OpenComponentFile(cmpFile);

 

//Display the mapping dialog.

vmap.ShowUserInterface(false, false, 0, cmpFile, true);

 

//Save the map file.

vmap.SaveMapFile(mapFile);