Rem:
To count the pages in MSWord document, we need to follow following steps:
1 Create an object of Word Application.
2 Open the required Word document using the open() function of Documents collection of Word document. This function returns the Word.Document object.
3 Cal the ComputeStatistics fumction on Word.Document object passing it an enum WdStatistic with value equal to wdStatisticPages. This function will return the number of pages in the opened word document.