NamedRange.AutoOutline Method (2007 System)
Automatically creates an outline for the NamedRange control.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
Public Function AutoOutline As Object
'Usage
Dim instance As NamedRange
Dim returnValue As Object
returnValue = instance.AutoOutline()
public Object AutoOutline()
public:
Object^ AutoOutline()
public function AutoOutline() : Object
Return Value
Type: System.Object
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.
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 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
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();
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.