Compile Code to use in Synopsis for Word Count

When I compile an outline to MS Word/PDF, I have mine setup to include the Synopsis. It would be nice to have a Compile Code that would export the word count for that text file.