Metodo NamedRange.ClearNotes (System 2007)

Aggiornamento: novembre 2007

Cancella le note in tutte le celle nel controllo NamedRange.

Spazio dei nomi:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Sintassi

Public Function ClearNotes As Object

Dim instance As NamedRange
Dim returnValue As Object

returnValue = instance.ClearNotes()
public Object ClearNotes()

Valore restituito

Tipo: System.Object

Esempi

Nell'esempio di codice riportato di seguito viene aggiunta una nota a un controllo NamedRange denominato NamedRange1. Viene quindi chiesto di rimuovere tutte le note da NamedRange1 mediante una chiamata al metodo ClearNotes.

Questo esempio è valido per una personalizzazione a livello di documento.

Private Sub SetRangeFormats()
    Dim namedRange1 As Microsoft.Office.Tools.Excel.NamedRange _
        = Me.Controls.AddNamedRange(Me.Range("A1", "A5"), _
        "namedRange1")

    namedRange1.NoteText("This is a Formatting test", , )
    namedRange1.Value2 = "Martha"
    namedRange1.Font.Name = "Verdana"
    namedRange1.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
    namedRange1.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter
    namedRange1.BorderAround(, Excel.XlBorderWeight.xlThick, _
        Excel.XlColorIndex.xlColorIndexAutomatic, )
    namedRange1.AutoFormat( _
        Excel.XlRangeAutoFormat.xlRangeAutoFormat3DEffects1, _
        True, False, True, False, True, True)

    If MessageBox.Show("Clear the formatting and notes?", _
        "Test", MessageBoxButtons.YesNo) = DialogResult.Yes Then
        namedRange1.ClearFormats()
        namedRange1.ClearNotes()
    End If
End Sub

private void SetRangeFormats()
{
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Controls.AddNamedRange(this.Range["A1", "A5"],
        "namedRange1");

    namedRange1.NoteText("This is a Formatting test", missing, missing);
    namedRange1.Value2 = "Martha";
    namedRange1.Font.Name = "Verdana";
    namedRange1.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
    namedRange1.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
    namedRange1.BorderAround(missing, Excel.XlBorderWeight.xlThick,
        Excel.XlColorIndex.xlColorIndexAutomatic, missing);
    namedRange1.AutoFormat(Excel.XlRangeAutoFormat.xlRangeAutoFormat3DEffects1,
        true, false, true, false, true, true);

    if (MessageBox.Show("Clear the formatting and notes?", "Test",
        MessageBoxButtons.YesNo) == DialogResult.Yes)
    {
        namedRange1.ClearFormats();
        namedRange1.ClearNotes();
    }
}

Autorizzazioni

Vedere anche

Riferimenti

NamedRange Classe

Membri NamedRange

Spazio dei nomi Microsoft.Office.Tools.Excel