<p>I need to determine which pages of a Word document that a keyword occurs on.  I have some tools that can get me the text of the document, but nothing that tells me which pages the text occurs on.  Does anyone have a good starting place for me?  I'm using .NET</p>

<p>Thanks!</p>

<p>edit: Additional constraint: I can't use any of the Interop stuff.</p>

<p>edit2: If anybody knows of stable libraries that can do this, that'd also be helpful.  I use Aspose, but as far as I know that doesn't have anything.</p>

This is how I get the text out,  I believe you can set set the selection range to a page, then you could test that text, might be a little backwards from what you need but could be a place to start.
```
```
Microsoft.Office.Interop.Word.Application wordApplication = new Microsoft.Office.Interop.Word.Application();
object missing = Type.Missing;
object fileName = @"c:\file.doc";
object objFalse = false;

wordApplication.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;
Microsoft.Office.Interop.Word.Document doc = wordApplication.Documents.Open(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref objFalse, ref missing, ref missing, ref missing, ref missing);

//I belevie you can define a SelectionRange and insert here
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();

IDataObject data = Clipboard.GetDataObject();
string text = data.GetData(DataFormats.Text).ToString();

doc.Close(ref missing, ref missing, ref missing);
doc = null;

wordApplication.Quit(ref missing, ref missing, ref missing);
wordApplication = null;
```
```