DocumentBase.DefaultTableStyle Property

 

Gets the table style that is applied to all newly created tables in the document.

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

public object DefaultTableStyle { get; }

Property Value

Type: System.Object

The table style that is applied to all newly created tables in the document.

The following code example uses the DefaultTableStyle property to test whether the table style is set to Table Normal. If the table style is different, the code sets the default table style to the Table Normal style. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentDefaultTableStyle()
{
    object tableStyle = "Table Normal";
    if (this.DefaultTableStyle != tableStyle)
    {
        this.SetDefaultTableStyle(ref tableStyle, false);
    }
}
Return to top
Show: