首页 > 资讯列表 > 软件学院 >> 系统程序

如何实现在线创建Word与Excel文档

系统程序 2014-11-30 19:21:54 转载来源: 网络整理/侵权必删

      有些人对于能够在线创建Word与Excel文档感到很是惊讶和好奇,以前可是从没有听过和碰过类似的问题。那么具体该怎么操作才能够实现嗯?其实这个也是需要一定的工具的

  

    有些人对于能够在线创建WordExcel文档感到很是惊讶和好奇,以前可是从没有听过和碰过类似的问题。那么具体该怎么操作才能够实现嗯?其实这个也是需要一定的工具的。可是使用动态服务器页面ASP来实现,ASP具备动态输出任一Office应用程序文件格式的功能。在开始编写代码之前,我们首先需要做的就是设置正确的文件类型,因为浏览器需要知道如何处理文件。第二步是编辑文件名称,我们可以使用HTML和CSS来创建Word文档或Excel文档的样式。 下面这段例子代码可用于在线创建Word文档。 以下是引用片段: <% Response.ContentType = "application/msword" Response.AddHeader "Content-Disposition", "attachment;filename=NAME.doc"???  response.Write("Dotnetindex.com : <a href=""http://www.dotnetindex.com"">Visit Site</a><br>" & vbnewline) response.Write("<h1>We can use HTML codes for word documents</h1>") response.Write ("<div style=""padding:4px; font:11px arial"">CSS can be used tooo</span>") %> 下面这段例子代码可用于在线创建Excel文档。 以下是引用片段: <% Response.AddHeader "Content-Disposition", "attachment;filename=members.xls" Response.ContentType = "application/vnd.ms-excel" response.write "<table width="100%" border="1" >" response.write "<tr>" response.write "<th width=""40%""><b>Name</b></th>" response.write "<th width=""30%""><b>Username</b></th>" response.write "<th width=""30%""><b>Password</b></th>" response.write "</tr>" response.write "<tr>" response.write "<td width=""40%"">Scud Block</td>" response.write "<td width=""30%"">scud@gazatem.com</td>" response.write "<td width=""30%"">mypassword</td>" response.write "</tr>" response.write "</table>" %>

(责任编辑:admin)

标签: 如何 实现 在线 创建 Word Excel 文档


声明:本文内容来源自网络,文字、图片等素材版权属于原作者,平台转载素材出于传递更多信息,文章内容仅供参考与学习,切勿作为商业目的使用。如果侵害了您的合法权益,请您及时与我们联系,我们会在第一时间进行处理!我们尊重版权,也致力于保护版权,站搜网感谢您的分享!

站长搜索

http://www.adminso.com

Copyright @ 2007~2024 All Rights Reserved.

Powered By 站长搜索

打开手机扫描上面的二维码打开手机版


使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

站长搜索目录系统技术支持