Freigeben über


Bookmark.Cells-Eigenschaft

Ruft eine Cells-Auflistung ab, die die Tabellenzellen in einem Bookmark-Steuerelement darstellt.

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

Syntax

'Declaration
ReadOnly Property Cells As Cells
Cells Cells { get; }

Eigenschaftswert

Typ: Microsoft.Office.Interop.Word.Cells
Eine Cells-Auflistung, die die Tabellenzellen in einem Bookmark-Steuerelement darstellt.

Beispiele

Im folgenden Codebeispiel wird dem Dokument eine Tabelle mit drei Spalten und drei Zeilen hinzugefügt. Anschließend wird der Tabelle ein Bookmark-Steuerelement hinzugefügt. Zum Schluss wird im Code die Breite der Tabellenzellen innerhalb des Lesezeichens geändert.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Private Sub BookmarkCells()

    Dim myTable As Word.Table
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    myTable = Me.Tables.Add(Me.Paragraphs(1).Range, 3, 3)
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(myTable.Range, "Bookmark1")
    If Bookmark1.Tables.Count > 0 Then
        Bookmark1.Cells.Width = Application.InchesToPoints(1)
    End If

End Sub
private void BookmarkCells()
{
    Word.Table myTable;

    this.Paragraphs[1].Range.InsertParagraphBefore();
    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");
    if (bookmark1.Tables.Count > 0)
    {
        bookmark1.Cells.Width = Application.InchesToPoints(1);
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Bookmark Schnittstelle

Microsoft.Office.Tools.Word-Namespace