title: Get pages of word document
body: <p>I'm trying to get all pages of MSWord document via Microsoft.Office.Interop.Word (I'm using C# in VS2012). What I would like to get is List&lt; String >  Pages, where index is the number of page.  I understand (at least I think so) that there is no direct way to do that. So I came up with something like that:</p>
  
  <pre><code>        List&lt;String&gt; Pages = new List&lt;String&gt;();
          int NumberOfPreviousPage = -1;
          int NumberOfPage = -1;
          string InnerText = "";
          for (int i = 0; i &lt; Doc.Paragraphs.Count; i++)
          {
              Paragraph CurrentParagraph = Doc.Paragraphs[i + 1];
              InnerText = CurrentParagraph.Range.Text;
              NumberOfPage = CurrentParagraph.Range.get_Information(WdInformation.wdActiveEndPageNumber);
              if (NumberOfPage == NumberOfPreviousPage)
                  Pages[Pages.Count - 1] += String.Format("\r\n{0}", InnerText);
              else
              {
                  Pages.Add(InnerText);
                  NumberOfPreviousPage = NumberOfPage;
              }
          }
  </code></pre>
  
  <p>But, when algorithm gets to paragraph, which starts on one page and ends on another, it decides that paragraph should be on next page. I want to split this paragraph between pages, but I don't know how to detect where I have to do the split.</p>