I have to paste the datatable to word without headers. I read range the table without header (unchecked) and when I use activity Insert datatable into word document it still ads the headers.
This is the table:
I read it without headers, and still it inserts the table like this in word:
in case if you still wish to delete headers
Try to use read range activity, in this activity you can read whole datatable and if you go through the properties of read range activity you can see AddHeaders checkbox. just uncheck that checkbox.
pass output data table variable in write range correct.
In write range properties uncheck AddHeaders.
To Perform this, we actually would need some external c# or vb.net code. But If we know that the Values of a Single Row would not be the same, then We can make the first row of the Datatables as the Column Headers first. Then Remove the First row.
This way the Rows are Intact while the Header Names/Column Names are removed.
Take a Look at the below Implementation :
We get the First Row Values in the form of an Object Array.
drArray = DT.Rows(0).ItemArray.ToArray
drArray is a Variable of Type Array of Object.
Now we would require to Change the Column Names of the Datatable, which we can perform using For Each Activity as shown below :
I have done some testing and the only time Insert DataTable in Document ignore the headers is when your column names are named Column1, Column2, Column3, etc. This explains why it works to insert data table without headers from Build Data Table and Generate Data Table activities since the columns are named correctly. Unfortunately for you the Read Range activity starts the column name from zero (i.e Column0, Column1, Column2).
To solve your issue, either rename the columns or use Generate Data Table to build a data table with correct column names.