![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I have more than 500 tables in Word. All of them have horizontal green borders at the top and bottom of the table, and some horizontal lines inside the table. Because of a mistake, some lines inside the same table and between tables have different green colors.
All the tables have merged cell in the first row. Tables have diferent numbers of rows and columns. I need to unify the color of visible borders of all tables to the same green (RGB:0,128,0). I'm very new with VBA. I have been looking at this for weeks without any success. Attached is an example of the tables in my word document. Someone give me this code, but only works with the first top border: Sub colorBorders() Dim i As Integer Dim tabl As Table For Each tabl In ActiveDocument.Tables ' iterate all the tables For i = 1 To tabl.Borders.Count ' iterate all borders for each table tabl.Borders(i).Color = RGB(0, 128, 0) Next i Next tabl End Sub |
Tags |
color, table borders, vba word |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
rocky2 | Word VBA | 12 | 12-22-2016 03:03 AM |
VBA merging cells and counting Merged rows | Snaybot | Excel Programming | 2 | 11-09-2015 03:56 AM |
Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells | CodingGuruInTraining | Word VBA | 24 | 10-07-2015 07:48 PM |
![]() |
wendyloooo | Word Tables | 1 | 05-26-2015 01:19 PM |
![]() |
pgrewal | Drawing and Graphics | 1 | 07-18-2014 11:12 PM |