DataTable Interface

Represents a table shape on a slide. The Table object is a member of the Shapes collection. The Table object contains the Columns collection and the Rows collection.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
<GuidAttribute("92D41A63-F07E-4CA4-AF6F-BEF486AA4E6F")> _
Public Interface DataTable
'Usage
Dim instance As DataTable
[GuidAttribute("92D41A63-F07E-4CA4-AF6F-BEF486AA4E6F")]
public interface DataTable

Examples

Use Shapes(index), where index is a number, to return a shape containing a table. Use the HasTable property to see if a shape contains a table. This example walks through the shapes on slide one, checks to see if each shape has a table, and then sets the mouse click action for each table shape to advance to the next slide.

With ActivePresentation.Slides(2).Shapes

    For i = 1 To .Count

        If .Item(i).HasTable Then

            .Item(i).ActionSettings(ppMouseClick) _

                .Action = ppActionNextSlide

        End If

    Next

End With

Use the Merge(Cell) method of the Table object to access the contents of each cell. This example inserts the text "Cell 1" in the first cell of the table in shape five on slide three.

ActivePresentation.Slides(3).Shapes(5).Table _

    .Cell(1, 1).Shape.TextFrame.TextRange _

    .Text = "Cell 1"

Use the AddTable(Int32, Int32, Single, Single, Single, Single) method to add a table to a slide. This example adds a 3x3 table on slide two in the active presentation.

ActivePresentation.Slides(2).Shapes.AddTable(3, 3)

See Also

Reference

DataTable Members

Microsoft.Office.Interop.PowerPoint Namespace