As with any event you need to add it correctly. You cannot just add a method called “DesktopApplication.DocumentOpened”. As with any event you click on the object you wish to add to, in this case the App object of your project, and then click the + popup in the lower toolbar:
and choose Event Handler… from the popup menu:
a dialog will open and you can choose the event you want:
Once you have it then the code looks something along the line of this:
Sub DocumentOpened(item As FolderItem) Handles DocumentOpened
If item <> Nil Then
' Process the folderitem as if you had it provided by a file open dialog box...
End If
End Sub