C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Read WORD DOCUMENTS in ASP.net


Posted Date: 05 Jan 2008    Resource Type: Articles    Category: Web Applications

Posted By: Kamal       Member Level: Gold
Rating:     Points: 20



Here simple code for Reading Word Documents in ASP.NET 2.0. Here convert Doc file to Html File.

Imports class:

Imports Word
Imports System.Reflection

Code:


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DocToHtml("C:\WordApplication\document\Test.doc", "C:\WordApplication\document\a.html")
End Sub


Private Sub DocToHtml(ByVal docPath As String, ByVal htmlPath As String)


Dim app As New Application()

app.Visible = False

Dim o As Object = Missing.Value

Dim docFile As Object = docPath

Dim doc As _Document = app.Documents.Open(docFile, o, o, o, o, o, _
o, o, o, o, o, o, _
o, o, o, o)

Dim fileName As Object = htmlPath

Dim format As Object = 8
'Html

doc.SaveAs(fileName, format, o, o, o, o, _
o, o, o, o, o, o, _
o, o, o, o)

Dim t As Object = True

app.Quit(t, o, o)
End Sub





Responses

Author: Anjum Rizwi    08 Apr 2008Member Level: Silver   Points : 0
Which version of word DLL we will take reference.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Draw Signature or images in Asp.net Web Page
Previous Resource: Sending Email with ASP.NET 2.0
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

it help desk

Contact Us    Privacy Policy    Terms Of Use