Style.Table (Word)

Devuelve un objeto TableStyle que representa las propiedades que se pueden aplicar a una tabla mediante un estilo de tabla.


Sub NewTableStyle() 
 Dim styTable As Style 
 
 Set styTable = ActiveDocument.Styles.Add( _ 
 Name:="TableStyle 1", Type:=wdStyleTypeTable) 
 
 With styTable.Table 
 
 'Apply borders around table, a double border to the heading row, 
 'a double border to the last column, and shading to last row 
 .Borders(wdBorderTop).LineStyle = wdLineStyleSingle 
 .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle 
 .Borders(wdBorderLeft).LineStyle = wdLineStyleSingle 
 .Borders(wdBorderRight).LineStyle = wdLineStyleSingle 
 
 .Condition(wdFirstRow).Borders(wdBorderBottom) _ 
 .LineStyle = wdLineStyleDouble 
 
 .Condition(wdLastColumn).Borders(wdBorderLeft) _ 
 .LineStyle = wdLineStyleDouble 
 
 .Condition(wdLastRow).Shading _ 
 .BackgroundPatternColor = wdColorGray125 
 
 End With 
End Sub