获取一个 Cells 集合,该集合表示 Bookmark 控件中的表单元格。
命名空间:  Microsoft.Office.Tools.Word
程序集:  Microsoft.Office.Tools.Word(在 Microsoft.Office.Tools.Word.dll 中)
语法
声明
ReadOnly Property Cells As Cells
    Get
Cells Cells { get; }
属性值
类型:Microsoft.Office.Interop.Word.Cells
一个 Cells 集合,表示 Bookmark 控件中的表单元格。
示例
下面的代码示例向文档中添加一个三列三行的表,然后向该表添加一个 Bookmark 控件。 最后,该代码更改书签中这些表单元格的宽度。
此示例针对的是文档级自定义项。
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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。