Application.OpenDocument event

From Xojo Documentation

Event


Application.OpenDocument(item as FolderItem)

Supported for all project types and targets.

The user has double-clicked on a document which this app is specified to open or the OpenDocument method was called.

Sample Code

This code loads the text of the supplied file into a TextArea on Window1:

If item <> Nil Then
Var input As TextInputStream
input = TextInputStream.Open(item)

Var w As New Window1
w.TextArea1.Value = input.ReadAll
w.Show

input.Close
End If