Search code examples
blueprism

How to read table in Word using Blue Prism


I have a table in word document which contains multiple row and column. I wanted to loop all rows in a particular column and read the values.

Please advise what appropriate action in the MS Word Business object to be used


Solution

  • MS Word VBO "Get Table Cell Value" (Action Stage) will capture the contents of any cells in a Word table. You need to specify the Table Number i.e. the position of the table from 1 from the top of the document (i.e. if more than one table per document, right to left for tables side-by-side!); also the cell position x & y (i.e. row and column, left to right). However, please note that in Word it will also capture the carriage return character at the end of each string. So after you get the content captured into a data item by "Get Table Cell Value", you need to first "trim" the string before you store it into a collection or write it to document, you can do this by using a Calculation stage like shown in the screenshot. The "Get Table Cell Value" stage: enter image description here The Calculation (Trim) stage: enter image description here.