For W3E2, I abstracted out the writing of the file, and added some RegEx when calling Word.