string[] NamesArr = {"CompanyName", "ProductName", "URL"};
object[] ValuesArr = {"SoftArtisans", "WordWriter",
"http://www.softartisans.com"};
WordTemplate WordTempl = new WordTemplate();
WordTempl.Open(Page.MapPath("./BasicTemplate.doc"));
//--- Set the data source of the repeat block "ProductInfo"
//--- by passing the value array and the name array initialized above.
WordTempl.SetRepeatBlock(ValuesArr, NamesArr, "ProductInfo");
WordTempl.Process();
WordTempl.Save(Page.Response, "BasicGenerated.doc", false);
|