.KEY filename
If EXISTS "<filename>"
delete "<filename>" FORCE/S QUIET/S >nil:
endif
xadunfile "ram:t/template.docx" "ram:t/tmpdoc" QUIET/S >nil:
copy "ram:t/document.xml" "ram:t/tmpdoc/word/" QUIET/S
cd "ram:t/tmpdoc"
zip -q -r -m "<filename>" * >nil:
cd "ram:"
delete "ram:t/tmpdoc" ALL/S QUIET/S FORCE/S
If EXISTS "<filename>.zip"
rename "<filename>.zip" "<filename>" >nil:
endif
