Merged code for docx and word into one document.