InsertIndent Method (2007 System)
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

NamedRange.InsertIndent Method (2007 System)

Adds an indent to the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

public void InsertIndent(
	int InsertAmount
)

Parameters

InsertAmount
Type: System.Int32

The amount to be added to the current indent.

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

Use the IndentLevel property to return the indent level for a range.

The following code example creates a NamedRange and then uses the InsertIndent method to set an indent level for the NamedRange.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange addIndentRange;
private void AddIndent()
{
    addIndentRange = this.Controls.AddNamedRange(
        this.Range["B4", missing], "addIndentRange");
    this.addIndentRange.Value2 = "Smith";
    this.addIndentRange.InsertIndent(2);
}

Show:
© 2016 Microsoft