write ( 'test-output.docx' ) Here is a sample of what the final document will look like: This is a simple document but pretty much anything you can do in Word can be turned into a template and populated in this manner.