Class DataTable (Word VBA)

The class DataTable represents a chart data table.

Set

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

Dim dte as DataTable
Set dte = ActiveDocument.Background.Chart.DataTable

DataTable class variables can be set using the Chart.DataTable procedure.

Border

Returns the border of the object.

Dim cbrBorder As ChartBorder
Set cbrBorder = ActiveDocument.Background.Chart.DataTable.Border

Delete

Deletes the object.

ActiveDocument.Background.Chart.DataTable.Delete

Font

Returns the font of the specified object.

Dim cftFont As ChartFont
Set cftFont = ActiveDocument.Background.Chart.DataTable.Font

Format

Returns the line, fill, and effect formatting for the object.

Dim cftFormatted As ChartFormat
Set cftFormatted = ActiveDocument.Background.Chart.DataTable.Format

HasBorderHorizontal

True if the chart data table has horizontal cell borders.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart 
 .HasDataTable = True 
 With .DataTable 
 .HasBorderHorizontal = False 
 .HasBorderVertical = False 
 .HasBorderOutline = True 
 End With 
 End With 
 End If 
End With

HasBorderOutline

True if the chart data table has outline borders.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart 
 .HasDataTable = True 
 With .DataTable 
 .HasBorderHorizontal = False 
 .HasBorderVertical = False 
 .HasBorderOutline = True 
 End With 
 End With 
 End If 
End With

HasBorderVertical

True if the chart data table has vertical cell borders.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart 
 .HasDataTable = True 
 With .DataTable 
 .HasBorderHorizontal = False 
 .HasBorderVertical = False 
 .HasBorderOutline = True 
 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.Parent

Select

Selects the object.

ActiveDocument.Background.Chart.DataTable.Select

ShowLegendKey

True if the data label legend key is visible.

ActiveDocument.Background.Chart.DataTable.ShowLegendKey = True