Bookmark.TopLevelTables Property (2007 System)

Gets a Tables collection that represents the tables at the outermost nesting level in the range of the Bookmark control.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property TopLevelTables As Tables
'Usage
Dim instance As Bookmark 
Dim value As Tables 

value = instance.TopLevelTables
[BrowsableAttribute(false)]
public Tables TopLevelTables { get; }
[BrowsableAttribute(false)]
public:
property Tables^ TopLevelTables {
    Tables^ get ();
}
public function get TopLevelTables () : Tables

Property Value

Type: Tables
A Tables collection that represents the tables at the outermost nesting level in the Bookmark control.

Remarks

This method returns a collection containing only those tables at the outermost nesting level within the context of the range of the Bookmark control. These tables may not be at the outermost nesting level within the entire set of nested tables.

Examples

The following code example adds a Bookmark control to the table in the document, then pastes the table, as a nested table, to the third cell. The code then selects the next table in the bookmark.

This example is for a document-level customization.

Private Sub BookmarkTopLevelTables()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim myTable As Word.Table = Me.Tables.Add( _
        Me.Paragraphs(1).Range, 3, 3)

    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(myTable.Range, "Bookmark1")

    myTable.Range.Copy()
    myTable.Range.Cells(3).Range.PasteAsNestedTable()
    Dim Index As Integer = 1
    Bookmark1.TopLevelTables(Index).Select()

End Sub
private void BookmarkTopLevelTables()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Word.Table myTable = this.Tables.Add(this.Paragraphs[1].Range,
        3, 3, ref missing, ref missing);
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(myTable.Range,
        "bookmark1");
    myTable.Range.Copy();
    myTable.Range.Cells[3].Range.PasteAsNestedTable();
    int index = 1;
    bookmark1.TopLevelTables[index].Select();
}

.NET Framework Security

See Also

Reference

Bookmark Class

Bookmark Members

Microsoft.Office.Tools.Word Namespace