Partager via


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)

Syntax

'Declaration
Public ReadOnly Property DefaultTableStyle As Object
public Object DefaultTableStyle { get; }

Property Value

Type: System.Object
The table style that is applied to all newly created tables in the document.

Examples

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 Sub DocumentDefaultTableStyle()
    Dim tableStyle As Object = "Table Normal" 
    If Me.DefaultTableStyle <> tableStyle Then 
        Me.SetDefaultTableStyle(tableStyle, False)
    End If 
End Sub
private void DocumentDefaultTableStyle()
{
    object tableStyle = "Table Normal";
    if (this.DefaultTableStyle != tableStyle)
    {
        this.SetDefaultTableStyle(ref tableStyle, false);
    }
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace