Returns the path to Microsoft Word as a String.
Use this function do determine the location of Microsoft Word on the computer.
When Word is not found on the current computer, then an empty String is returned.
If an error occurred, then "ERROR" is returned.
Example for a returned String:
/Applications/Microsoft Office 2011/Microsoft Word.app
Returns:
Type |
Value |
Description |
String |
empty String |
Microsoft Word was not found on the computer |
String |
ERROR |
In case of any error the string "ERROR" is returned |
String |
path to app |
When Word was found, then the path to the application bundle is returned, like: /Applications/Microsoft Office 2011/Microsoft Word.app |
Available in:
WindowMain |
WindowLink |
YES |
YES |
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 '%WordGetPath%'
Example XojoScript:
// Retrieve the installation path of Microsoft Word
Dim v As String = WordGetPath
If v = "" Then
MsgBox "Word is not installed!"
ElseIf v = "ERROR" Then
MsgBox "An error occured!"
Else
Dim t As String
If Instr(v,"2011")>0 Then
MsgBox "Word 2011 is installed here : " + EOL + EOL + v
Else
MsgBox v
End If
End If