Message-ID: <65907775.9767.1711702345909.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9766_1308145623.1711702345909" ------=_Part_9766_1308145623.1711702345909 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Sets or returns the content-type header that will be sent to the browser= with the generated Word document.
=20public System.String ContentType{ get; set; }=20
Public Property ContentType() As String=20
... WordTemplate WordTempl =3D 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.wordprocessin= gml.document //--- and for .docm files is //--- application/vnd.ms-word.document.macroEnabled.12 WordTempl.ContentType =3D "application/unknown"; WordTempl.Process(); WordTempl.Save(Page.Response, "BasicGenerated.doc", fal= se); ...=20
... 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.wordprocessing= ml.document '--- and for .docm files is '--- application/vnd.ms-word.document.macroEnabled.12 WordTempl.ContentType =3D "application/unknown" WordTempl.Process() WordTempl.Save(Page.Response, "BasicGenerated.doc", Fal= se) ...=20