RSS Forums RSS
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting

Reading Document file

Join Date: Jan 2008
Location: India
Posts: 178
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 8
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Reading Document file

  #1  
May 14th, 2008
hi..

to read a document file in Asp.Net and Vb.net as a Code behind , Use following Code

    Sub Read(ByVal RPath As String)
        If RPath <> "" Then
            Dim WordApp As New Word.ApplicationClass
            Dim filepath = Server.MapPath("images\Resume\") & RPath
            Dim File As Object = filepath
            Dim nullobj As Object = System.Reflection.Missing.Value

            Dim doc As Word.Document = WordApp.Documents.Open(File, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj)

            Dim doc1 As Word.Document = WordApp.ActiveDocument

            Dim m_Content As String = doc1.Content.Text

            txtResume.Text = m_Content

        doc.Close(nullobj, nullobj, nullobj)
        End If
    End Sub

here in ResumePath send the file name to read.

Best Luck
Accept Challenges and Enjoy Coding... :)
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:24 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC