Update 2009/11/21: The utility displays the number of pages instead of the number of lines.
Counting words in a Microsoft Office Word document through the Microsoft Office Word application is trivial. Just click on the Word Count option from the Tools menu. Sometimes, though, it would be nice to be able to count and display the number of words in a document through a command line utility like the way Unix’s wc utility does for normal text files.
For that reason, I have written a small utility in C# that does exactly that. It opens Microsoft Office Word documents, counts their lines, words and characters and displays the results. Some code was borrowed from http://forums.asp.net/t/1440851.aspx. To run the utility you need the Microsoft.Office.Interop.Word.dll somewhere in your PATH. You can download this library by downloading the Microsoft Visual Studio Tools for the Microsoft Office system.