A Word document can be created with the help of following VB.NET code:
Dim NamesArr As String() = {"Name", "Company", "DateTime"}
' Form an array containg the values to be inserted
Dim ValuesArr As Object() = {recipName, recipCompany, System.DateTime.Now}
' Create an instance of WordTemplate
Dim wt As WordTemplate = New WordTemplate
' Open the template document
Dim templatePath As String = Page.MapPath("templates/BasicTemplate.doc")
wt.Open(templatePath)
' Set the main data source with the Name and Value arrays
wt.SetDataSource(ValuesArr, NamesArr)
' Populate the template to pull in the new values
wt.Process()
' Save the document by streaming it
wt.Save(Page.Response, "BasicWordTemplate.doc", False)