title: RTF number of pages Page x of y
body: <p>Not sure if this is even possible but I am trying to save text via a plain text output to an RTF with special coding.  </p>
  
  <p>I have everything working except the total number of pages.  </p>
  
  <p>I want it to say "Page x of y", the bottom of each page to say "Page 1 of 3" for example, but I can't find the correct code for the total page number.  </p>
  
  <p>Some people said use <code>\nofpages</code> but the source says the use of <code>\nofpagesN</code> is the specify the number of pages in the document.  Is there a formula or something I can use or maybe a way to put the last page number?  Here is an example of my code, if you put it into an rtf file via notepad then save and open in wordpad or word you will see what I mean:</p>
  
  <pre>
  {\rtf1\pagestart1 {\header\brdrt\brdrth\ql\b Name:  \b0LAST, FIRST \par\b DOB:  \b0 1979/11/03 \par\b Service Date/Time:  \b0 2012/03/06 00:49:00 \par\b MRN:  \b0 XXXXXX \par\b Order Date/Time:  \b0 2012/03/05 01:14:00 \par\b Study ID:  \b0 } \par{\footer\pard\brdrt\brdrs\qc\fs16\b\ul CONFIDENTIALITY NOTICE \par\par\pard\brdrt\brdrs\keepn\ql\fs20 Date: \chdate\par\keepn\qc\fs20 Page \chpgn  of \nofpages\par}\b Study ID:  \b0 000000000000 \par\pard\brdrb\brdrth A bunch of text to make up more than one page. \par \par \par {\footnote\pard\b Some stuff in the footer \b0\par}}
  </pre>