Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: selection Word insert
Im seeking to make application that archiving word documents
I face a problem in searching the content of those files on aspecefic text , so i decieded to insert the files in database , where each page will be arecord in atable have the name of the decument.
i can read from the document file, but in need to select each page and insert them in a table.
 Dim word As New Microsoft.Office.Interop.Word.Application
        Dim doc As Microsoft.Office.Interop.Word.Document
            doc = word.Documents.Open("C:\Users\Public\Documents\Search Engine Optimization.doc")
            ' word.WindowState = word.WdWindowState.wdWindowStateNormal
            '  word.Visible = True

            doc.ActiveWindow.Selection.SetRange(0, 2060)
            Dim data As DataObject
            data = Clipboard.GetDataObject()
            RichTextBox1.Text = data.GetData(DataFormats.Text).ToString()
            ' doc.Range.InsertAfter("Text Added at " & TimeOfDay.ToShortDateString)
        Catch ex As COMException
            MessageBox.Show("Error accessing Word document.")
        End Try
i used this code to read , i need a help for select each page recursevily!
Or Code for searching multible files contents?
Posted 26-Feb-12 23:20pm
ryanb31 at 27-Feb-12 8:22am
Refer to on how to search through multiple files.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 27 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100