Step 1: To access a Word file throughout the entire process, a global instance must be created first so that automation can differentiate between different Word windows (if multiple are created). The Create Word Application command helps in performing this task.
- Select Create Word Application command
- Enter a Word Instance Name. (This is the OBAppInstance variable used to identify the Word file opened by this command and used throughout the automation.) (Example: Testing)
- In the New/Open Document field, choose the “New Document” option to create and open a new Word document. If the user wants to open a document, then select “Open Document” and provide the file path to the document.
- The Document File Path parameter will only appear when opening a document. If the user were to try and open a document, entering ProjectPath +@ “\FileName.extension” (replacing FileName.extension with the desired file name and extension) causes the automation to look in the project folder next to the Main.JSON and project.config files. This will ensure that the file path will be valid on any computer that the automation is run on.
- Set Visibility to “No” because viewing the document while the automation runs is not necessary for this guide.
- Set the Close All Existing Word Instances field to “Yes” so that any existing open Word instances are closed and do not interfere with the automation.
- Finally, Click OK.