ASP
  Home arrow ASP arrow Page 3 - Introducing SoftArtisans OfficeWriter 3.0 ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

Introducing SoftArtisans OfficeWriter 3.0 Enterprise, with ASP Features
By:
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 32
    2005-09-27

    Table of Contents:
  • Introducing SoftArtisans OfficeWriter 3.0 Enterprise, with ASP Features
  • Many Features, But Easy to Use
  • Generating a Word Document
  • Generating an Excel Document
  • Documentation and Support

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Introducing SoftArtisans OfficeWriter 3.0 Enterprise, with ASP Features - Generating a Word Document


    (Page 3 of 5 )

     

    Let us now work out a short demo of how easy it is to generate a Word document using ASP.NET.

    You can use either a plain text editor such as NotePad or Visual Studio .NET. If you decide to work with NotePad, you should place the two DLL files (SAWW3NET.dll & SAXW6NET.dll) inside the bin folder on the working directory. If you work with Visual Studio .NET, you should add references to the above DLL files. With VS.NET, you can take advantage of its IntelliSense feature, which will simplify the coding process.   

    The first step is to import the required namespaces as shown below:

    Imports System
    Imports System.Web.UI
    Imports SoftArtisans.OfficeWriter.WordWriter

    The Word file can be easily generated using the following code:

    Namespace SoftArtisans.WordWriter.MyOfficeWriter

     Public Class MyWordDoc : Inherits System.Web.UI.Page
     
      Private wordapp As WordApplication
      Private docu As Document

      Protected Sub Page_Load(sender As Object, e As EventArgs)
       TriggerDocument()
      End Sub
      
      Private Sub TriggerDocument()
      
       wordapp = New WordApplication()
       docu = wordapp.Create()
                    
       wordapp.Save(docu, Page.Response, "MyWordDocument.doc", False)
      End sub
     End Class
    End Namespace

    Additionally, you can add text to the Word file using the code given below:

    docu.InsertTextAfter("This document is generated by SoftArtisans OfficeWriter Enterprise Edition. ", False)
    docu.InsertTextAfter("This document is generated using 30 days evaluation edition", False)

    The final output will be as shown in the figure given below:

    More ASP Articles
    More By


       · I'm the author of this article. Please post your comments and I will try my best to...
     

    ASP ARTICLES

    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application
    - Easy Error Management





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway