First, you have to convert it into a .doc with a converter, it's more easy to export a pdf with tcpdf or some other lib.
Second if you want to force a download or display a file you have to send the header() before you echo the first line of the html <html>
.