Bookmark.Cells Özellik

Tanım

CellsDenetimdeki tablo hücrelerini temsil eden bir koleksiyon alır Bookmark .

public Microsoft.Office.Interop.Word.Cells Cells { get; }

Özellik Değeri

Cells

CellsBir denetimdeki tablo hücrelerini temsil eden bir koleksiyon Bookmark .

Örnekler

Aşağıdaki kod örneği, belgeye üç sütunlu, üç satırlık bir tablo ekler ve sonra Bookmark tabloya bir denetim ekler. Son olarak, kod, yer işareti içindeki tablo hücrelerinin genişliğini değiştirir.

Bu örnek, belge düzeyinde özelleştirme içindir

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);
    }
}
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

Şunlara uygulanır