Reading a Table from Word, Reading a untitled notepad

Hello All,

1) I have a process. In which I have a Word Document. In that I have some paragraphs and some Tables in the same word document. Can any one route me How would I be able to read the Paragraphs totally as a Data item and can I read the table in the word doc as collection or ?
Please let me know if there is ant VBO to read the data from work . Also help me to read only table from the word file.

2) I have a untitled.txt it is not saved , its opened and has some text in it ....I want to read the untitled.txt and bring it to the process.

3)Also I am looking to pass Dynamic Variables to a process.


Appreciate your Valuable inputs

Regards,
Shabaz
 

VJR

Well-Known Member
Please let me know if there is ant VBO to read the data from work .
MS Word VBO is used to interact with a Word document.

2) Spy the Notepad window and use wild card in the Window Title parameter of the Navigate stage>Attach action.
Spy the Text area of the notepad where all the content is written.
Using a Reader stage you can read all the text from this Text area.

3) Passing of Dynamic variables from where to where?
 
MS Word VBO is used to interact with a Word document.

2) Spy the Notepad window and use wild card in the Window Title parameter of the Navigate stage>Attach action.
Spy the Text area of the notepad where all the content is written.
Using a Reader stage you can read all the text from this Text area.

3) Passing of Dynamic variables from where to where?

Thanks VJR!
 

RPA_1

Member
word VBO doesn't have Get table option. Any code which can be used to get any of the tables from Word simply by providing the table number? Also, can we not search text >255 characters in word document ? The inbuilt action "Find Text" workd with only <255 characters in string for performing a search? Kindly suggest.
 

Sachin_Kharmale

Active Member
word VBO doesn't have Get table option. Any code which can be used to get any of the tables from Word simply by providing the table number? Also, can we not search text >255 characters in word document ? The inbuilt action "Find Text" workd with only <255 characters in string for performing a search? Kindly suggest.
Hi,

If you want to get table from Blue prism Word VBO Follow the following steps ,

1.Create new action in Blue prism MS Word VBO as Get Table as Collection
View attachment 1560859886358.png
2.start stage input will be
View attachment 1560859909253.png
3.add Code stage input will be same as start stage
View attachment 1560859934426.png


Code stage code will be like
Dim doc = GetDocument(handle,documentname)
'Creating new output data table
OutputTable =new System.Data.DataTable("Output")
'Here we are creating columns for output collection
'For index As Integer = 1 To doc.Tables(TableNumber).Columns.Count
For index As Integer = 1 To doc.Tables(TableNumber).Columns.Count
Dim col As System.Data.DataColumn = New System.Data.DataColumn("Column"&index)
OutputTable.Columns.Add(col)
Next

For rowindex As Integer = 1 To doc.Tables(TableNumber).Rows.Count
Dim v(doc.Tables(TableNumber).Columns.Count-1) As Object
For colindex As Integer = 1 To doc.Tables(TableNumber).Columns.Count
v(colindex-1)=(doc.Tables(TableNumber).Cell(rowindex,colindex).Range.Text.ToString().Remove(doc.Tables(TableNumber).Cell(rowindex,colindex).Range.Text.ToString().Length - 1, 1))
Next
OutputTable.Rows.Add(v)
Next

4.Code stage output will be collection which contain table data
View attachment 1560859964171.png
5. publish action from object studio and call it from process studio
View attachment 1560860008562.png
6.your input will be word file which contains 2 table i will extract data from second table
View attachment 1560860041327.png
7.your process flow look like

View attachment 1560860099422.png

Just pass the Handle , Document name, and table number to get data to action as input
View attachment 1560860519545.png
8.after execution Get Table as Collection you will get output in collection
View attachment 1560860450620.png


I hope it will help you.
 
Hi,

If you want to get table from Blue prism Word VBO Follow the following steps ,

1.Create new action in Blue prism MS Word VBO as Get Table as Collection
View attachment 4126
2.start stage input will be
View attachment 4127
3.add Code stage input will be same as start stage
View attachment 4128


Code stage code will be like
Dim doc = GetDocument(handle,documentname)
'Creating new output data table
OutputTable =new System.Data.DataTable("Output")
'Here we are creating columns for output collection
'For index As Integer = 1 To doc.Tables(TableNumber).Columns.Count
For index As Integer = 1 To doc.Tables(TableNumber).Columns.Count
Dim col As System.Data.DataColumn = New System.Data.DataColumn("Column"&index)
OutputTable.Columns.Add(col)
Next


For rowindex As Integer = 1 To doc.Tables(TableNumber).Rows.Count
Dim v(doc.Tables(TableNumber).Columns.Count-1) As Object
For colindex As Integer = 1 To doc.Tables(TableNumber).Columns.Count
v(colindex-1)=(doc.Tables(TableNumber).Cell(rowindex,colindex).Range.Text.ToString().Remove(doc.Tables(TableNumber).Cell(rowindex,colindex).Range.Text.ToString().Length - 1, 1))
Next
OutputTable.Rows.Add(v)
Next


4.Code stage output will be collection which contain table data
View attachment 4129
5. publish action from object studio and call it from process studio
View attachment 4130
6.your input will be word file which contains 2 table i will extract data from second table
View attachment 4131
7.your process flow look like

View attachment 4132

Just pass the Handle , Document name, and table number to get data to action as input
View attachment 4134
8.after execution Get Table as Collection you will get output in collection
View attachment 4133


I hope it will help you.

Awesome !
 

shiva21

New Member
Hi,

If you want to get table from Blue prism Word VBO Follow the following steps ,

1.Create new action in Blue prism MS Word VBO as Get Table as Collection
View attachment 4126
2.start stage input will be
View attachment 4127
3.add Code stage input will be same as start stage
View attachment 4128


Code stage code will be like
Dim doc = GetDocument(handle,documentname)
'Creating new output data table
OutputTable =new System.Data.DataTable("Output")
'Here we are creating columns for output collection
'For index As Integer = 1 To doc.Tables(TableNumber).Columns.Count
For index As Integer = 1 To doc.Tables(TableNumber).Columns.Count
Dim col As System.Data.DataColumn = New System.Data.DataColumn("Column"&index)
OutputTable.Columns.Add(col)
Next


For rowindex As Integer = 1 To doc.Tables(TableNumber).Rows.Count
Dim v(doc.Tables(TableNumber).Columns.Count-1) As Object
For colindex As Integer = 1 To doc.Tables(TableNumber).Columns.Count
v(colindex-1)=(doc.Tables(TableNumber).Cell(rowindex,colindex).Range.Text.ToString().Remove(doc.Tables(TableNumber).Cell(rowindex,colindex).Range.Text.ToString().Length - 1, 1))
Next
OutputTable.Rows.Add(v)
Next


4.Code stage output will be collection which contain table data
View attachment 4129
5. publish action from object studio and call it from process studio
View attachment 4130
6.your input will be word file which contains 2 table i will extract data from second table
View attachment 4131
7.your process flow look like

View attachment 4132

Just pass the Handle , Document name, and table number to get data to action as input
View attachment 4134
8.after execution Get Table as Collection you will get output in collection
View attachment 4133


I hope it will help you.

I am getting this error when I check the code in the code stage. Can you please help.
" Description: Compiler error at line 1: 'GetDocument' is not declared. It may be inaccessible due to its protection level. "
 

Sachin_Kharmale

Active Member
Hi @sornakumar92 ,

If you want to get table from outlook body try bellow steps ..
1.Read mail from that you want extract table.you will get mail in html format.
2.if you get mail in html format then your code contain html tag like <table><th><tr><td>.
3.Based on table html data you can store data in collection.

I hope it will help you....!!!

 
Top