RTF will be the easiest because it is a simple text format. This is similar to HTML, but without closing tags. Here is the class for writing RTF, but this requires a lot of dependencies from other sources within the framework.
DOCX would be quite difficult. This is actually a zip file containing multiple XML files. You can learn the format yourself by changing the .docx extension to .zip and unzipping it. But even though the XML format is pretty simple to write, the way to structure text attributes is still pretty complicated. In addition, I remember that it needs to be cleaned in a very specific way so that it can be read correctly.
As for the DOC, it will be very difficult because it is such a complex format. You can see some open source projects like Abiword or Word2x . Be careful using your code because licenses may not comply with Store Store policies.
source share