Sets or returns the content-type header that will be sent to the browser with the generated Word document.

 public System.String ContentType{ get; set; }
Public Property ContentType() As String

ContentType must not be used before Open is called, as the content-type of the file cannot be known until after the file is opened. Getting or setting ContentType before calling Open will throw an exception.


          ...
          WordTemplate WordTempl = new WordTemplate();
          WordTempl.Open(Page.MapPath("./BasicTemplate.doc"));
          WordTempl.SetDataSource(MyDataTable);

          //--- Set the ContentType
          //--- ContentType is application/vns.ms-word by default for
          //--- .doc files, while the default ContentType for
          //--- .docx files is
          //--- application/vnd.openxmlformats-officedocument.wordprocessingml.document
          //--- and for .docm files is
          //--- application/vnd.ms-word.document.macroEnabled.12
          WordTempl.ContentType = "application/unknown";
          WordTempl.Process();
          WordTempl.Save(Page.Response, "BasicGenerated.doc", false);
          ...
        

          ...
          Dim WordTempl As New WordTemplate()
          WordTempl.Open(Page.MapPath("./BasicTemplate.doc"))
          WordTempl.SetDataSource(MyDataTable)

          '--- Set the ContentType
          '--- ContentType is application/vns.ms-word by default for
          '--- .doc files, while the default ContentType for
          '--- .docx files is
          '--- application/vnd.openxmlformats-officedocument.wordprocessingml.document
          '--- and for .docm files is
          '--- application/vnd.ms-word.document.macroEnabled.12
          WordTempl.ContentType = "application/unknown"
          WordTempl.Process()
          WordTempl.Save(Page.Response, "BasicGenerated.doc", False)
          ...