If you want to save a Write area as an RTF document programmatically
using the command:
WR SAVE DOCUMENT (areaRef;docName;docType)
You must pass "RTF " as the desired file type (note space at end to make it four characters long - corresponding with Mac file type). For example:
WR SAVE DOCUMENT (WriteField;"test";"RTF ")
Will correctly create an RTF document containing the contents of the Write area.