Bookmark.Cells-Eigenschaft
Visual Studio 2005
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)
Assembly: Microsoft.Office.Tools.Word (in microsoft.office.tools.word.dll)
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.
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); } }