Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
VB
Dim word As New Microsoft.Office.Interop.Word.Application
       Dim doc As Microsoft.Office.Interop.Word.Document

       Try
           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)

           doc.ActiveWindow.Selection.Copy()

           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
Comments
ZurdoDev 27-Feb-12 8:22am    
Refer to http://ryandev.com/how-to-find-and-replace-within-multiple-microsoft-office-word-documents/ 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900