Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-01-22 08:43 AM
Hi,
I have a table in MS Word. This table has multiple rows with multiple boxes. Each box has an "x" and "y" which is obtained by hit and trial method.
I want to add a row in between the table, after a specific row. After adding that row, I want to merge all the cells in that row.
Not sure how I can achieve this.
I tried using Add Rows - MS Word VBO action but it adds row at the end of the table. This doesn't help me out.
Looking forward for help from you guys.
Thanks in advance !!
------------------------------
Swati Agrawal
------------------------------
I have a table in MS Word. This table has multiple rows with multiple boxes. Each box has an "x" and "y" which is obtained by hit and trial method.
I want to add a row in between the table, after a specific row. After adding that row, I want to merge all the cells in that row.
Not sure how I can achieve this.
I tried using Add Rows - MS Word VBO action but it adds row at the end of the table. This doesn't help me out.
Looking forward for help from you guys.
Thanks in advance !!
------------------------------
Swati Agrawal
------------------------------
Answered! Go to Answer.
1 BEST ANSWER
Helpful Answers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-01-22 10:21 AM
Hey Swati,
You are right that the "Add Table Rows" action adds new rows at the end of any given table in the word document. I have listed down the steps below in order to achieve your use case.
Solution Implementation:
In order to achieve this, we can extend the "MS Word VBO" by creating a separate action within it and you can call it as "Add Table Rows At Position". This action will be having the following input parameters:
Refer to the below workflow for more information:


Now, add a custom code stage with the following Input parameters and the code as shown below. No output parameters are required:


Code:
You can publish this action and run the same from Process Studio to check your results.
Some of the test results are shown below:
Scenario I: The table I have has three rows by default and I want to add three rows below the second row:


Result of the action is:

Let us know if this helps you out!
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
You are right that the "Add Table Rows" action adds new rows at the end of any given table in the word document. I have listed down the steps below in order to achieve your use case.
Solution Implementation:
In order to achieve this, we can extend the "MS Word VBO" by creating a separate action within it and you can call it as "Add Table Rows At Position". This action will be having the following input parameters:
- Handle (Number) : The data item having the handle value in the instance dictionary that needs to be queried. (This you can get from Create Instance action)
- Document Name (Text) : The document name of the current workbook which the Blur Prism bot is operating on. (This you can get from Open Workbook action)
- Table Number (Number) : The table element index used in the current workbook to identify the table.
- Cell X (Number) : The row number of the cell which will be considered as the reference for deciding the rows to be added below or above. (The index value starts from 1)
- Cell Y (Number) : The column number of the cell which will be considered as the reference for deciding the rows to be added below or above. (The index value starts from 1)
- Number Of Rows (Number) : The number of rows which need to be added below or above the reference cell. (The value should be greater than 0)
- Insert After Mode (Flag) : The flag value determining whether the rows need to be added above or below the reference cell. (If the value is True, rows will be added below the reference cell otherwise the rows will be added above the reference cell)
Refer to the below workflow for more information:
Now, add a custom code stage with the following Input parameters and the code as shown below. No output parameters are required:
Code:
Dim doc as Object = GetDocument(Handle,Document_Name)
doc.Tables.Item(Table_Number).Cell(Cell_Y_Number,Cell_X_Number).Range.Select
If Number_Of_Rows = 0 Then Throw New Exception("Number of rows must be greater than zero.")
If Insert_After_Mode Then
For i = 1 To Number_Of_Rows
doc.ActiveWindow.Selection.InsertRowsBelow()
Next
Else
For i = 1 To Number_Of_Rows
doc.ActiveWindow.Selection.InsertRowsAbove()
Next
End If
You can publish this action and run the same from Process Studio to check your results.
Some of the test results are shown below:
Scenario I: The table I have has three rows by default and I want to add three rows below the second row:
Result of the action is:
Let us know if this helps you out!
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-01-22 10:21 AM
Hey Swati,
You are right that the "Add Table Rows" action adds new rows at the end of any given table in the word document. I have listed down the steps below in order to achieve your use case.
Solution Implementation:
In order to achieve this, we can extend the "MS Word VBO" by creating a separate action within it and you can call it as "Add Table Rows At Position". This action will be having the following input parameters:
Refer to the below workflow for more information:


Now, add a custom code stage with the following Input parameters and the code as shown below. No output parameters are required:


Code:
You can publish this action and run the same from Process Studio to check your results.
Some of the test results are shown below:
Scenario I: The table I have has three rows by default and I want to add three rows below the second row:


Result of the action is:

Let us know if this helps you out!
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
You are right that the "Add Table Rows" action adds new rows at the end of any given table in the word document. I have listed down the steps below in order to achieve your use case.
Solution Implementation:
In order to achieve this, we can extend the "MS Word VBO" by creating a separate action within it and you can call it as "Add Table Rows At Position". This action will be having the following input parameters:
- Handle (Number) : The data item having the handle value in the instance dictionary that needs to be queried. (This you can get from Create Instance action)
- Document Name (Text) : The document name of the current workbook which the Blur Prism bot is operating on. (This you can get from Open Workbook action)
- Table Number (Number) : The table element index used in the current workbook to identify the table.
- Cell X (Number) : The row number of the cell which will be considered as the reference for deciding the rows to be added below or above. (The index value starts from 1)
- Cell Y (Number) : The column number of the cell which will be considered as the reference for deciding the rows to be added below or above. (The index value starts from 1)
- Number Of Rows (Number) : The number of rows which need to be added below or above the reference cell. (The value should be greater than 0)
- Insert After Mode (Flag) : The flag value determining whether the rows need to be added above or below the reference cell. (If the value is True, rows will be added below the reference cell otherwise the rows will be added above the reference cell)
Refer to the below workflow for more information:
Now, add a custom code stage with the following Input parameters and the code as shown below. No output parameters are required:
Code:
Dim doc as Object = GetDocument(Handle,Document_Name)
doc.Tables.Item(Table_Number).Cell(Cell_Y_Number,Cell_X_Number).Range.Select
If Number_Of_Rows = 0 Then Throw New Exception("Number of rows must be greater than zero.")
If Insert_After_Mode Then
For i = 1 To Number_Of_Rows
doc.ActiveWindow.Selection.InsertRowsBelow()
Next
Else
For i = 1 To Number_Of_Rows
doc.ActiveWindow.Selection.InsertRowsAbove()
Next
End If
You can publish this action and run the same from Process Studio to check your results.
Some of the test results are shown below:
Scenario I: The table I have has three rows by default and I want to add three rows below the second row:
Result of the action is:
Let us know if this helps you out!
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-01-22 12:35 PM
Hi Devneet,
Thanks.
Actually when I run this, then it says complile error in code. Not sure why.
Still finding out.
------------------------------
Swati Agrawal
------------------------------
Thanks.
Actually when I run this, then it says complile error in code. Not sure why.
Still finding out.
------------------------------
Swati Agrawal
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-01-22 12:20 AM
Hi Swati,
I cross checked the code and it is working on my system with the same solution provided. You can perhaps check the variable names as in some instances instead of handle and document name I am using Handle and Document Name. You can also let us know what is the exact error you are getting if you are not able to implement the same.
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
I cross checked the code and it is working on my system with the same solution provided. You can perhaps check the variable names as in some instances instead of handle and document name I am using Handle and Document Name. You can also let us know what is the exact error you are getting if you are not able to implement the same.
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
