Creating Word Files Online ~ ASP Coding Guide

Tuesday, February 13, 2007

Creating Word Files Online

ASP has the ability to dynamically output any kind of office application format. Before to start coding, The first thing we need to do is set correct file type. Becase the browser needs to know what to do with the file. Second step is to edit file name. You can use HTML and CSS to create styles in your word document.


Here is a comple source code :

<%

Response.ContentType = "application/msword"

Response.AddHeader "Content-Disposition", "attachment;filename=NAME.doc"

response.Write("Dotnetindex.com : Visit Site
" & vbnewline)


response.Write("

We can use HTML codes for word documents

")


response.Write ("
CSS can be used tooo")

%>

<% Response.ContentType = "application/msword" Response.AddHeader "Content-Disposition", "attachment;filename=NAME.doc" response.Write("Dotnetindex.com : Visit Site
" & vbnewline)

response.Write("

We can use HTML codes for word documents

")

response.Write ("
CSS can be used tooo")

%>

No comments: