Go to Location in Office
Allows the user to go to specific points in an Office file.
Command availability: IBM RPA SaaS and IBM RPA on premises
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
officeGoTo --location(String) --officeapplication(OfficeApplication) (Boolean)=value
Dependencies
-
To use this command, open an Office file with the Open Office file (
officeOpen
) command. -
Microsoft™ Office 2010 or higher is required.
-
Ensure that the architecture (bitness) of your Office apps, IBM RPA, and your operating system match. For example, if you are using a 64-bit operating system, IBM RPA and Office must be 64-bit too.
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Location | location |
Required |
Text |
Specific location in the Office file. |
Office Application | officeapplication |
Required |
Office Application |
Variable that stores the Office application instance. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Success | value | Boolean |
Returns True if successful in reaching the specified location, and False otherwise. |
Example
The Open Office File command opens a Word file, which is stored in the variable "officeApplication", which is used to go to Location
"Page 1"
and assign the value "IBM" to this location, if true.
defVar --name officeApplication --type OfficeApplication
defVar --name success --type Boolean
defVar --name assignedValue --type String
defVar --name locationInFile --type String
setVar --name "${locationInFile}" --value 1
setVar --name "${assignedValue}" --value "IBM"
// Use a sample File.
officeOpen --path "Sample file" --type "Word" --keepvisibleofficeApplication=officeapplication
officeGoTo --location "${locationInFile}" --officeapplication ${officeApplication} success=value
if --left "${success}" --operator "Is_True"
officeSet --location "${locationInFile}" --value ${assignedValue} --officeapplication ${officeApplication}
endIf
officeSave --fileformat "Default" --officeapplication ${officeApplication}
officeClose --officeapplication ${officeApplication}
❕ Important: To use the sample script, use a sample file and enter its path in the File Path
parameter of the Open Office File command.