Using the Get Document Text Function

The following example walks you through the process of using a function of Office Library that returns all text from the document.

There is no need to capture screen elements in the MS Office applications in order to use Office Library.

This example will show how a specific callout is displayed with text of the active document by Real-Time Client each time you click the link in the callout.

To use the Office Library - Example:

1. In the Real-Time Designer, go to Business Entities module and select the Types tab.
2. Create a New Business Entities type.

3. Add a New Property of Text type to the Business Entity Type. The text of the document is assigned to this Business Entity property. Give the name of the property, for example, Returned Text.

4. Add a New Function to the Business Entity Type is created. Give the function a name. For example, Get Document Text.

5. Click Insert Instruction and select Assignment.

6. Click <Select Object…>.

7. Select the Returned Text business entity property.

8. Click <Enter Value…> and go to the Library Object item.
9. Select MS Word in the list.

10. Select Get Document Text function in the list.

11. Click <Select document name…>.

12. Go to the Library Object in the assignment tool, open MS Word library list and select Get Active Document Name function.

13. In the Business Entities tree, under New Type, right-click the new entity and select Create an instance of “New Type”.
14. Go to the Presentation module and create a New Blank Callout.

15. Under Insert Instruction, select Function Invocation.

16. Click <Select Function…>, and select the Get Document Text function that has been created in the Business Entities module.

17. Define the name of the link in the Action Name field and click OK in the Action Link window to add the action link to the callout.

18. Click the Insert Dynamic Text button in the ribbon to insert the returned text of Get Document Text function into callout.

19. Select Business Entities in the assignment list and select Returned Text business entity property that has been created in the Business Entity module.

20. Go to the Project tab in the Real-Time Designer. Then, on the Quick tab add New Callout.

21. Save the project and click the Test Project button on the Quick Access Toolbar. Select Run Real-Time Client to run the project locally on the client’s machine.

22. Open the Word document in MS Office Word.
23. Click the Quick button in the Real-Time Client to display the callout.

24. Click the Get Document Text link in the callout to run the function and get the text of the active Word document.