Class LegendKey (Word VBA)

The class LegendKey represents a legend key in a chart legend.

The main procedure of class LegendKey is Delete

Set

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

Dim lky as LegendKey
Set lky = ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey

LegendKey class variables can be set using the LegendEntry.LegendKey procedure.

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Format with its procedures ClearFormats, Format, MarkerBackgroundColor, MarkerBackgroundColorIndex, MarkerForegroundColor, MarkerForegroundColorIndex and MarkerStyle

Methods

This is the main method of the LegendKey class

Delete - Deletes the object.

ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Delete

Properties

Height returns the height, in points, of the object.

Dim dblHeight As Double
dblHeight = ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Height

InvertIfNegative true if Microsoft Word inverts the pattern in the object when it corresponds to a negative number.

ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.InvertIfNegative = True

Left returns the distance, in points, from the left edge of the object to the left edge of the chart area.

Dim dblLeft As Double
dblLeft = ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Left

MarkerSize returns or sets the data-marker size, in points.

ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.MarkerSize =

Parent returns the parent for the specified object. Read-only object.

Dim objParent As Object
Set objParent = ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Parent

PictureType returns or sets the way pictures are displayed on a legend key.

ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.PictureType =

PictureUnit2 returns or sets the unit for each picture on the chart if the PictureType property is set to xlStackScale; otherwise, this property is ignored.

ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.PictureUnit2 =

Shadow returns or sets a value that indicates whether the object has a shadow.

ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Shadow = True

Smooth true if curve smoothing is turned on for the legend key.

ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Smooth = True

Top returns the distance, in points, from the top edge of the object to the top of the first row (on a worksheet) or the top of the chart area (on a chart).

Dim dblTop As Double
dblTop = ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Top

Width returns the width, in points, of the object.

Dim dblWidth As Double
dblWidth = ActiveDocument.Background.Chart.Legend.LegendEntries(1).LegendKey.Width