No sir, it will not work for .docx file format.
It will create the .docx file but when we try to open it in microsoft word, it say "The file text.docx cannot be opened because there are problems with the content" (file is corrupt and cannot be opened) :(