NamedRange.AutoOutline Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Automatically creates an outline for the NamedRange control.
public:
System::Object ^ AutoOutline();
public object AutoOutline ();
abstract member AutoOutline : unit -> obj
Public Function AutoOutline () As Object
Returns
Examples
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"],
"namedRange1");
namedRange1.AutoOutline();
if (MessageBox.Show("Clear the outline?", "Test",
MessageBoxButtons.YesNo) == DialogResult.Yes)
{
namedRange1.ClearOutline();
}
}
Private Sub SetOutline()
Dim namedRange1 As Microsoft.Office.Tools.Excel.NamedRange _
= Me.Controls.AddNamedRange(Me.Range("A1", "C5"), _
"namedRange1")
namedRange1.AutoOutline()
If MessageBox.Show("Clear the outline?", "Test", _
MessageBoxButtons.YesNo) = DialogResult.Yes Then
namedRange1.ClearOutline()
End If
End Sub
Remarks
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.