Question Application for reading text in excel file and searching it in MS Word

sumathi

New member
Joined
Mar 31, 2011
Messages
1
Programming Experience
Beginner
Hi All,

I am not an ardent developer in vb.net programming. But off late I am using vb.net to develop a windows application.

The following is what I am trying to do:

I am reading an excel file and storing the text value in each cell and trying to match the string in a word file.

The program works fine except that I am having problems in returning the page numbers of the matched string.

The page number value is always returned as one.

The following is a piece of what I had written:

If FindStringInFile(wordfilename, vValues) Then
currentPageNumber = word.ActiveDocument.ActiveWindow.Selection.Range.Information(Microsoft.Office.Interop.Word.WdInformation.wdActiveEndAdjustedPageNumber)
TextBox3.Text = currentPageNumber
End If

wordfilename is my word file and vValues is my excel text data

Thanks in Advance for the help!
 
Is the Selection object really relevant? Have you changed selections, and is that intended or needed?
 
Back
Top