Bookmark.Columns Property

Definition

Gets a Columns collection that represents all the table columns in the Bookmark control.

C#
public Microsoft.Office.Interop.Word.Columns Columns { get; }

Property Value

A Columns collection that represents all the table columns in the Bookmark control.

Examples

The following code example adds a three-column, three-row table to the document, adds a Bookmark control to the table, then changes the width of the first column within the bookmark.

This example is for a document-level customization.

C#
private void BookmarkColumns()
{
    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.Columns[1].Width = Application.InchesToPoints(1);
    }
}

Applies to

Product Versions
Visual Studio Tools for Office 2017, 2019, 2022