Dave T
08-09-2010, 06:33 PM
Hello All,
I have been using the following code to format the borders of a table.
However the code formats all the internal horizontal table borders the same (.LineStyle = wdLineStyleSingle and .LineWidth = wdLineWidth025pt).
I have been trying, without success, to format the bottom line of the heading row with a differnent line style (.LineStyle = wdLineStyleDouble and .LineWidth = wdLineWidth075pt)
With Selection.Tables(1)
.Rows.AllowBreakAcrossPages = False
.AllowAutoFit = False
.Rows(1).Shading.BackgroundPatternColor = wdColorAutomatic
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderHorizontal)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
End With
With .Borders(wdBorderVertical)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
End With
End With
Most of my attempt have been along the lines of using
.Rows(1).Borders(wdBorderBottom)
Each attempt generally ends with the following error:
Compile error: Invalid or unqualified reference
Any help would be appreciated.
Regards,
Dave T
I have been using the following code to format the borders of a table.
However the code formats all the internal horizontal table borders the same (.LineStyle = wdLineStyleSingle and .LineWidth = wdLineWidth025pt).
I have been trying, without success, to format the bottom line of the heading row with a differnent line style (.LineStyle = wdLineStyleDouble and .LineWidth = wdLineWidth075pt)
With Selection.Tables(1)
.Rows.AllowBreakAcrossPages = False
.AllowAutoFit = False
.Rows(1).Shading.BackgroundPatternColor = wdColorAutomatic
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth150pt
End With
With .Borders(wdBorderHorizontal)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
End With
With .Borders(wdBorderVertical)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth100pt
End With
End With
Most of my attempt have been along the lines of using
.Rows(1).Borders(wdBorderBottom)
Each attempt generally ends with the following error:
Compile error: Invalid or unqualified reference
Any help would be appreciated.
Regards,
Dave T