![]() |
|
#1
|
|||
|
|||
|
Could someone suggest a shorter code for this macro? Thanks!
Code:
Sub BorderColor()
MyColor = InputBox("Specify color code", "Border Color")
With Selection.ParagraphFormat
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = MyColor
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = MyColor
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = MyColor
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = MyColor
End With
With .Borders
.DistanceFromTop = 1
.DistanceFromLeft = 4
.DistanceFromBottom = 1
.DistanceFromRight = 4
.Shadow = False
End With
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = MyColor
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't change border color of Office windows | coffent | Office | 0 | 12-17-2020 09:21 AM |
Word 16/19 change font and outside border color (same color) eg is red change to pink
|
jec1 | Word VBA | 2 | 12-04-2019 11:32 PM |
VBA Word - Format ALL Tables - Apply Specific Formatting to Sets of Columns – Font, Border & Width
|
jc491 | Word VBA | 10 | 11-04-2015 04:02 PM |
How to change the color of Character Border?
|
tinfanide | Word | 4 | 10-27-2012 06:35 AM |
Apply font color programatically using VBA Word
|
divakarganta | Word VBA | 3 | 08-08-2012 08:05 PM |