Plugging game results into Microsoft Word template

In my game, I record the users starting health, number of deaths, length of play, XP gain, and number of kills. I want to be able to put these data values into a word template and then email that to myself. How would I go about doing this? Here is a rough template. [124516-unity-blank-template.pdf|124516]

Word documents themselves are deflate-compressed folders whose contents you can examine by renaming *.docx to *.zip. The document’s meat itself (especially for a purely-text document like this) can be found in /word/document.xml.

As for the process itself, it’s fairly straightforward, if a little involved due to the annoyance of unzipping and re-zipping the document’s components. You’ll need to:

1- Copy your template
2- Unzip and access contents of your copied template
3- Modify the document's /word/document.xml file *
4- Re-zip it
  • As for the modification step, the simplest way would be to set short placeholder strings for those values that are unlikely to appear elsewhere in the document. Something like __ND__ for Number of Deaths. You’d then replace all instances of __ND__ with that value, and proceed similarly for the other fields you want written.

It’s debatable whether this is related to Unity at all, so do be sure to ask Unity-relevant questions to this forum.