FileLaunch(filePath As String) As Boolean

 

Opens a file in its default application.

 

 

Parameters:

 

Name

Type

Description

filePath

String

The full path to the file to be opened.

fileName

String

The full name for the new file to be created, including extension.

 

 

Returns:

 

Type

Value

Description

String

pathToNewFile

The new file is created in a subfolder of the application data temp folder.  The full path to this file is returned by the function. If any error occurred, then an empty string is returned.

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

 Used in:

 

XojoScript Name

GUID

Create Seminar Invoice with Word

31EB5A79-78E5-4A8C-9101-5B118F113AB4

Create Seminar Reminder Invoice

A3DD8BD9-6141-44A1-AA82-5A2C78042209

 

Hint: You can find references to XojoScripts which make use of this function by sending the following SQL statement to the database:

Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%FileLaunch%'

 

Example XojoScript:

 

// Start Word and create a new template based document

Dim template As String = "imSeminarInvoice.doc"

 

Dim p1 As String = FileNew(template,"newinvoice.doc")

If p1 <> "" Then

Call FileLaunch(p1)  // Open File in Word

Else

MsgBox("Invoice file could not be created!")

Return

End If