I have a macro that applies a border as follows:
Code:
With Selection
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
End With
It works fine when I have selected about a page worth of text. However, when I select around two pages worth and run the code, I get "Run Time Error 5843: one of the values passed to this method or property is out of range." Can anyone offer any help? Thank you so much!