12-15-2014 07:37 AM
Hi,
I need some help working the table, row background color.
I have a doc different table. but this specific table will be place where the bookmark (test2) is. And that table should have all the even number rows colored in gray or any other color, just like all other table you see in the attached doc.
Any help?
Solved! Go to Solution.
12-15-2014 08:18 AM
Hi,
You can refer the link:
http://zone.ni.com/reference/en-XX/help/370274H-01/lvoffice/word_table_bord_and_shad/
You can color each and every row using start and end index individually.
Regards,
DCKAN
12-15-2014 09:13 AM
Word Table Borders and Shading VI seems to work but the only thing with this is that I must specify the table index otherwise it is putting it at the end of the document. and I am working with a document of 100 pages with more than 100 tables, too hard to find the index of each table...
Is there a work to use this VI with bookmark or ....
12-15-2014 10:23 AM
@agyna wrote:
Word Table Borders and Shading VI seems to work but the only thing with this is that I must specify the table index otherwise it is putting it at the end of the document. and I am working with a document of 100 pages with more than 100 tables, too hard to find the index of each table...
Is there a work to use this VI with bookmark or ....
Use Word Document Properties.vi from the Word General palette, there is a table count output. Insert a new table and then the table count will be the index of the table you just inserted.
Ben64
12-15-2014 01:01 PM
Thanks bu this is giving the total number of all the tables but not the specific one table I just created and inserted in the report.
12-15-2014 02:00 PM
Any help? I need to get the index number of a table in word doc. Say I have a doc with more then 20 table...
Thank you.
12-16-2014 12:57 PM
@agyna wrote:
Any help? I need to get the index number of a table in word doc. Say I have a doc with more then 20 table...
Thank you.
The index of a table is the numeral order of the table starting from the beginning of the document. Since you're using bookmarks to insert tables and the order seems to be random (you are not adding the tables at the end of the document) the index of a specific table is not a fix value. Say the index of a table is 2, if you insert a table before this one its index will change to 3.
There are no activeX property that return the index of a table because it is not a property of the table object. There are workarounds but that depend on what you want to do, do you want to modify the shading immediately after you added the new table or do you want to be able to get back to a specific table later after having done other operations?
Ben64
12-16-2014 01:08 PM
I just want to modify the shading of a table right after the table is inserted in the report, where ever that table goes, meaning where ever I put my bookmark to insert the table and on that specific table.
12-16-2014 01:36 PM
@agyna wrote:
I just want to modify the shading of a table right after the table is inserted in the report, where ever that table goes, meaning where ever I put my bookmark to insert the table and on that specific table.
Since we can't get the table index you will not be able to use the Word Table Borders and Shading.vi
Another way to grab a table handle is to use its range. To do this you will use the range (wd) - start (xl) output of the Append Table to Report.vi, unbundle this output to get the start(wd) and end(wd) value. You will now have to work with Word activeX properties and methods.
Here is a picture that show you how to do this. Now what you need to do is to get familiar with the Word activeX objects, the RGT (Report Generation Toolkit) is usefull for basic operation but want you want to do is beyond its scope.
I strongly recommend that you have a look at the methods and properties I used in the following screen shot and use this link to look carefully at their definition and at how to use them.
Ben64
12-16-2014 03:09 PM
This is perfect. Works really fine. I will learn from it.