Show RTF File content with formatting on Text Area

Here is what I did in a small test project, with my own User license file created in TextEDit. Works flawlessly.

[code]Sub Open() Handles Open
dim f as folderItem = SpecialFolder.Documents.child(“User_License.rtf”)

If f <> Nil Then
If f.Exists Then
system.DebugLog “loading”
// Be aware that TextInputStream.Open coud raise an exception
Dim t As TextInputStream
Try
t = TextInputStream.Open(f)
t.Encoding = Encodings.MacRoman
me.styledText.RTFData = t.ReadAll
Catch e As IOException
t.Close
MsgBox(“Error accessing file.”)
End Try
End If
End If
End Sub
[/code]

All I did was to modify the first example at http://documentation.xojo.com/index.php/Textinputstream

No complicated styledText value and intermediary variables. Plain, simple.