C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Read WORD DOCUMENTS in ASP.net


Posted Date: 05 Jan 2008    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: KamalMember Level: Gold    
Rating: 1 out of 5Points: 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  
Sign In to add 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: Interfaces in .NET
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use