Class ChartBorder (Word VBA)

The class ChartBorder represents the border of an object.

Set

To use a ChartBorder class variable it first needs to be instantiated, for example

Dim cbr as ChartBorder
Set cbr = ActiveDocument.Background.Chart.DataTable.Border

The following procedures can be used to set variables of type ChartBorder: Axis.Border, DataTable.Border, DropLines.Border, ErrorBars.Border, Gridlines.Border, HiLoLines.Border, LeaderLines.Border, Series.Border, SeriesLines.Border, Trendline.Border and UpBars.Border

Color

Returns or sets the primary color of the object.

ActiveDocument.Background.Chart.DataTable.Border.Color =

ColorIndex

Returns or sets the color of the border.

Possible Values are xlColorIndexAutomatic - Automatic color, xlColorIndexNone - No color.

The color is specified as an index value into the current color palette, or as one of the following XlColorIndex constants:

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart.Axes(xlValue) 
 If .HasMajorGridlines Then 
 ' Set the color to blue. 
 .MajorGridlines.Border.ColorIndex = 5 
 End If 
 End With 
 End If 
End With

LineStyle

Returns or sets the line style for the border. Read/write XlLineStyle, xlGray25, xlGray50, xlGray75, or xlAutomatic.

Possible Values are xl3DBar - Three-dimensional bar chart group or series, xl3DSurface - Three-dimensional surface chart group or series, xlAbove - The summary row is displayed above the specified range, xlAutomatic - Word applies automatic settings, such as a color or page number, to the specified object, xlBar - Two-dimensional bar chart group or series, xlBelow - The summary row is displayed below the specified range, xlBoth - Display positive and negative error bars in the specified chart group or series, xlBottom - Bottom, xlCenter - Center, xlChecker - Checker pattern, xlCircle - Circle, xlColumn - Columnar chart group or series, xlCombination - Combination, xlCorner - Corner, xlCrissCross - Criss-cross pattern, xlCross - Cross pattern, xlCustom - Word applies custom settings, such as a color or error amount, to the specified object, xlDefaultAutoFormat - Word applies default or automatic formatting, xlDiamond - Diamond pattern, xlDistributed - Distributed, xlFill - Fill, xlFixedValue - Display error amounts as a fixed value, xlGeneral - General, xlGray16 - 16% gray pattern, xlGray25 - 25% gray pattern, xlGray50 - 50% gray pattern, xlGray75 - 75% gray pattern, xlGray8 - 8% gray pattern, xlGrid - Grid pattern, xlHigh - High, xlInside - Inside, xlJustify - Justify, xlLeft - Left, xlLightDown - Light down line pattern, xlLightHorizontal - Light horizontal line pattern, xlLightUp - Light up line pattern, xlLightVertical - Light vertical line pattern, xlLow - Low, xlMaximum - Maximum, xlMinimum - Minimum, xlMinusValues - Minus values, xlNextToAxis - Next to axis, xlNone - Do not display error bars in the specified chart group or series, xlOpaque - Opaque fill, xlOutside - Outside, xlPercent - Display error amounts as a percentage, xlPlus - Display positive error bars in the specified chart group or series, xlPlusValues - Plus values, xlRight - Right, xlScale - Scale, xlSemiGray75 - 75% semi-gray pattern, xlShowLabel - Show label, xlShowLabelAndPercent - Show label and percent, xlShowPercent - Show percent, xlShowValue - Show value, xlSingle - Single line, xlSolid - Solid pattern, xlSquare - Square, xlStar - Star, xlStError - Display error amounts as a standard error, xlTop - Top, xlTransparent - Transparent fill, xlTriangle - Triangle.

The xlDouble and xlSlantDashDot constants of the xlLineStyle enumeration do not apply to charts.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart 
 .ChartArea.Border.LineStyle = xlDashDot 
 With .PlotArea.Border 
 .LineStyle = xlDashDotDot 
 .Weight = xlThick 
 End With 
 End With 
 End If 
End With 

Parent

Returns the parent for the specified object. Read-only object.

Dim objParent As Object
Set objParent = ActiveDocument.Background.Chart.DataTable.Border.Parent

Weight

Returns or sets the weight of the border. Read/write XlBorderWeight.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.Axes(xlValue).Border.Weight = xlMedium 
 End If 
End With