### Launch associated application to open file

This sub opens the associated application to open a file (requires the JavaObject library).
API References:
http://docs.oracle.com/javase/8/docs/api/java/awt/Robot.html
http://docs.oracle.com/javase/8/docs/api/java/awt/Desktop.html
'Launches the associated application to open a file.
'Parameter: Full path to the file
'Example: DesktopOpen(File.DirApp & "/helloworld.html")
'Example: DesktopOpen(File.DirApp & "/helloworld.txt")
`Sub DesktopOpen(path As String)
Dim joFile As JavaObject
Dim joDesktop As JavaObject
Try
'Log("Create file object for path: " & path)
joFile.InitializeNewInstance("java.io.File", Array As Object(path))
'Log("Create Desktop object")
joDesktop.InitializeStatic("java.awt.Desktop")
'Log("Open file using Desktop Object")
joDesktop.RunMethodJO("getDesktop", Null).RunMethod("open", Array As Object(joFile))
Catch
Log(LastException.Message)
End Try
End Sub`

Changed: , Category: JavaObject, File: T6C208M1524.htm, ID: 1524