{"id":75,"date":"2006-08-17T20:51:42","date_gmt":"2006-08-18T01:51:42","guid":{"rendered":"\/cgi\/wp\/?p=75"},"modified":"2006-08-17T20:51:42","modified_gmt":"2006-08-18T01:51:42","slug":"rich-text-format-aspnet","status":"publish","type":"post","link":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=75","title":{"rendered":"Rich Text Format &#038; ASP.NET"},"content":{"rendered":"<p>Today I learned how to use the Response.ContentType property to cause the browser to open an ASP.NET page as a Word document in the Rich Text Format.  I know how to do this in ASP to cause an Excel spreadsheet to a open in the browser. That has been one of my best technical tricks to impress a client. Now I know how to do it in ASP.NET.<\/p>\n<p>I can also add a line to the header so the RTF document will open as a file attachment. I&#8217;m using this technique in a few projects that require Word documents to be created with data from the database. I would usually do this using Word documents in HTML format but the Rich Text Format allows me to open a template file which is easier to update. My code reads the template document, replaces a few fields with database values, and then delivers a finished RTF document. The formatting of the template document can be easily changed without rewriting the code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I learned how to use the Response.ContentType property to cause the browser to open an ASP.NET page as a Word document in the Rich Text Format. I know how to do this in ASP to cause an Excel spreadsheet &hellip; <a href=\"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=75\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/75"}],"collection":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":0,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions"}],"wp:attachment":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}