Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

NamedRange.AutoOutline Method

Automatically creates an outline for the NamedRange control.

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

Object AutoOutline()

Return Value

Type: System.Object

If the NamedRange control is a single cell, Microsoft Office Excel creates an outline for the entire sheet. The new outline replaces any existing outline.

The following code example uses the AutoOutline method to create an outline for a NamedRange control, and then prompts the user to clear the outline by calling the ClearOutline method.

This example is for a document-level customization.

private void SetOutline()
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Controls.AddNamedRange(this.Range["A1", "C5"],


    if (MessageBox.Show("Clear the outline?", "Test",
        MessageBoxButtons.YesNo) == DialogResult.Yes)

© 2015 Microsoft