LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

word table, rows background color

Solved!
Go to solution

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?

 

Download All
0 Kudos
Message 1 of 10
(4,838 Views)

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


Best Regards,
DCKAN

"We make a Living by what we get. We make a Life by what we give."
0 Kudos
Message 2 of 10
(4,818 Views)

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 ....

0 Kudos
Message 3 of 10
(4,800 Views)

@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

0 Kudos
Message 4 of 10
(4,791 Views)

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.

0 Kudos
Message 5 of 10
(4,772 Views)

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.

0 Kudos
Message 6 of 10
(4,760 Views)

@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

0 Kudos
Message 7 of 10
(4,713 Views)

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.

0 Kudos
Message 8 of 10
(4,705 Views)
Solution
Accepted by topic author agyna

@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

 

ScreenShot055.png

Message 9 of 10
(4,695 Views)

This is perfect. Works really fine. I will learn from it.

0 Kudos
Message 10 of 10
(4,678 Views)