Share via


NamedRange.IndentLevel Property

Definition

Gets or sets the indent level for the NamedRange control.

public:
 property System::Object ^ IndentLevel { System::Object ^ get(); void set(System::Object ^ value); };
public object IndentLevel { get; set; }
member this.IndentLevel : obj with get, set
Public Property IndentLevel As Object

Property Value

The indent level for the NamedRange control.

Examples

The following code example creates a NamedRange and then uses the IIndentLevel property to set the indent level of the NamedRange to 3.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange indentRange;
private void SetIndentLevel()
{
    indentRange = this.Controls.AddNamedRange(
        this.Range["B4"], "indentRange");
    this.indentRange.Value2 = "Smith";
    this.indentRange.IndentLevel = 3;
}
Private indentRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub SetIndentLevel()
    indentRange = Me.Controls.AddNamedRange( _
        Me.Range("B4"), "indentRange")
    Me.indentRange.Value2 = "Smith"
    Me.indentRange.IndentLevel = 3
End Sub

Remarks

The indent level can be an integer from 0 to 15.

Using this property to set the indent level to a number less than 0 (zero) or greater than 15 causes an exception to be thrown.

Applies to