title: MS Word Automation - find the page number where a table is located
body: <p>I have a Word document that contains 10 tables. When I read values in these tables, I want to give a warning to operator to check table 4 on page 5.
  I can get the table number, but is there a way to indicate on what page that table is? A fragment of my code is below:</p>
  
  <pre><code>int nTable = 0;
  int nPage = 0;
  foreach (Word.Table tb in doc.Tables)
  {
    nTable++;
    nPage = PageNumberForTable(nTable); // I need a function like this
    numRows = tb.Rows.Count;
    numColumns = tb.Columns.Count;
  
    for (int row = 1; row &lt;= numRows; row++) 
    {
      for(int col = 1; col &lt;= numColumns; col++) 
      {
          var cell = tb.Cell(row, col); 
          cellValue = CleanRASpace(cell.Range.Text); 
          if(cellValue == 2) 
          {
             MessageBox.Show("Check table " + nTable + " on page " + nPage);
          }
      }
    }
  }
  </code></pre>