DesktopApplication.DocumentOpened

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Event


DesktopApplication.DocumentOpened(item as FolderItem)

New in 2021r3

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.Text = input.ReadAll
w.Show

input.Close
End If