Option
Explicit
Public
Sub
test()
Dim
lngIndex
As
Long
Application.ScreenUpdating =
False
With
Selection
If
.Type = wdSelectionRow
Then
If
.Tables.Count > 0
Then
For
lngIndex = 1
To
.Cells.Count
With
.Cells(lngIndex)
If
.Range.Characters.Count = 1
Then
If
Asc(.Range.Text) = 13
Then
_
Call
prcSetBorder(probjBorder:=.Borders(wdBorderDiagonalUp))
ElseIf
.Range.Characters.Count = 0
Then
Call
prcSetBorder(probjBorder:=.Borders(wdBorderDiagonalUp))
End
If
End
With
Next
End
If
End
If
End
With
Application.ScreenUpdating =
True
End
Sub
Private
Sub
prcSetBorder(
ByRef
probjBorder
As
Border)
With
probjBorder
.LineStyle = Options.DefaultBorderLineStyle
.LineWidth = Options.DefaultBorderLineWidth
.Color = wdColorRed
End
With
End
Sub