Click here to Skip to main content
11,709,844 members (77,417 online)
Rate this: bad
good
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
 
       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 26-Feb-12 22:20pm
Comments
ryanb31 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 514
1 OriginalGriff 250
2 Peter Leow 229
3 Maciej Los 180
4 Mika Wendelius 175
0 OriginalGriff 9,428
1 Sergey Alexandrovich Kryukov 9,037
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856


Advertise | Privacy | Mobile
Web04 | 2.8.150819.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