Click here to Skip to main content
11,798,546 members (71,375 online)
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 22: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)

  Print Answers RSS
0 CPallini 585
1 Maciej Los 395
2 OriginalGriff 348
3 Abhinav S 257
4 phil.o 254
0 OriginalGriff 2,150
1 Maciej Los 1,790
2 KrunalRohit 1,456
3 CPallini 1,415
4 Richard MacCutchan 1,016

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 27 Feb 2012
Copyright © CodeProject, 1999-2015
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