The Process method enters data source values in a template's merge fields, and creates an image of the output file (the new document) in memory.

 public void Process()
Public Sub Process()

The save method can then save the output file to disk, stream it to the browser, or both.

Call Process after SetDataSource and before Save.

You can only call Process once for each instance of WordTemplate.

Generate a single Word file:

            //--- Create an object array of values
            //--- and a string array of field names to pass to
            //--- SetDataSource.
            Object[] arrValue = {"SoftArtisans WordWriter"};
            string[] arrName = {"ProductName"};

            //--- Create an instance of WordTemplate.
            WordTemplate oWW = new WordTemplate();

            //--- Open a template file.
            oWW.Open(Server.MapPath(@"../StringVarTemplate.doc"));

            //--- Set the file's data source by passing
            //--- SetDataSource an array of values and an
            //--- array of merge field names.
            oWW.SetDataSource(arrValue, arrName);

            //--- Call Process() to populate the template with
            //--- the new data.
            oWW.Process();

            //--- After processing the template, call Save() and pass it
            //--- Page.Response to stream the generated file to the browser.
            oWW.Save(Page.Response, "StringVarOutput.doc", false);

            '--- Create an object array of values
            '--- and a string array of field names to pass to
            '--- SetDataSource.
            Dim arrValue As Object() = {"SoftArtisans WordWriter"}
            Dim arrName As String() = {"ProductName"}

            '--- Create an instance of WordTemplate.
            Dim oWW As New WordTemplate()

            '--- Open a template file.
            oWW.Open(Server.MapPath("./StringVarTemplate.doc"))

            '--- Set the file's data source by passing
            '--- SetDataSource an array of values and an
            '--- array of merge field names.
            oWW.SetDataSource(arrValue, arrName)

            '--- Call Process() to populate the template with
            '--- the new data.
            oWW.Process()

            '--- After processing the template, call Save() and pass it
            '--- Page.Response to stream the generated file to the browser.
            oWW.Save(Page.Response, "StringVarOutput.doc", False)