It appears that when you fetch the page count from a document, subsequent calls to range.replace no longer work. For example, in the code below none of the range.replace calls work AFTER the page count property is queried:
aspDoc.Range.Replace("[Fax.PageCount]", aspdoc.pagecount.tostring, False, False)
If strRecipientName <> vbNullString Then aspDoc.Range.Replace("[Fax.RecipientName]", strRecipientName, False, False)
If strRecipientNumber <> vbNullString Then aspDoc.Range.Replace("[Fax.RecipientNumber]", strRecipientNumber, False, False)
If strSubject <> vbNullString Then aspDoc.Range.Replace("[Fax.Subject]", strSubject, False, False)
If strNote <> vbNullString Then aspDoc.Range.Replace("[Fax.Note]", strNote, False, False)
If strDocumentName <> vbNullString Then aspDoc.Range.Replace("[Fax.DocumentName]", strDocumentName, False, False)
Everything after the first line of code above will execute but the range.replace function does not properly replace the tokens in the document. If I comment out the query to the page count, the remaining code will replace the tokens properly.