Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 7th, 2005, 10:26 AM
Authorized User
 
Join Date: Oct 2004
Location: Bangalore, Karnataka, India.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating word doc in ASP.NET

Hai,

    Anybody have Idea for creating word doc on the fly (Current web page) in ASP.NET?

Many codes are available on net which require word to be
installed on the hosting server.

    Thanks!

    :)



  #2 (permalink)  
Old December 10th, 2005, 04:01 AM
Authorized User
 
Join Date: Oct 2004
Location: Bangalore, Karnataka, India.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got the solution. :D

================================================== ===================

using System.IO;
using System.Text;
using System.Net;

private void Button1_Click(object sender, System.EventArgs e)
{
  WebClient webClient = new WebClient();
  const string strUrl = "http://www.yahoo.com/";
  byte[] arrHtml;
  arrHtml = webClient.DownloadData(strUrl);
  UTF8Encoding objUTF8 = new UTF8Encoding();
  using(FileStream fs = File.Create("c:\\sample-webpage.doc"))
  {
    byte[] arrContent = arrHtml;
    fs.Write(arrContent,0, arrContent.Length);
  }
}




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Open A Word Doc... using ASP .net nikks9 ASP.NET 1.0 and 1.1 Professional 8 March 31st, 2015 03:45 AM
UnauthorizedAccessException when creating Word doc VerbatimBOT ASP.NET 2.0 Professional 2 November 3rd, 2008 06:56 PM
Creating word doc - word behaviour mat41 Classic ASP Professional 2 April 29th, 2007 06:46 PM
How to store word doc in sql server using asp.net kv Priya .NET Framework 2.0 2 November 28th, 2006 09:38 AM
Creating word doc. thru .dot or XML document manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 2 March 1st, 2006 07:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.