WorksheetBase.Comments (Propiedad)

Obtiene una colección Microsoft.Office.Interop.Excel.Comments que representa todos los comentarios para la hoja de cálculo.

Espacio de nombres:  Microsoft.Office.Tools.Excel
Ensamblado:  Microsoft.Office.Tools.Excel.v4.0.Utilities (en Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Sintaxis

'Declaración
Public ReadOnly Property Comments As Comments
public Comments Comments { get; }

Valor de propiedad

Tipo: Microsoft.Office.Interop.Excel.Comments
Colección Microsoft.Office.Interop.Excel.Comments que representa todos los comentarios de la hoja de cálculo.

Ejemplos

El ejemplo de código siguiente usa la propiedad Comments para mostrar el número de comentarios de la hoja de cálculo actual antes y después de agregar un comentario a la celda A1.

Se trata de un ejemplo para una personalización en el nivel del documento.

Private Sub GetCommentsCount()
    MsgBox("Before adding a comment, there are " & _
        Me.Comments.Count & " comments in the worksheet.")

    Me.Range("A1").AddComment( _
        ("This is a comment for cell" & " A1"))

    MsgBox("After adding a comment, there are " & _
        Me.Comments.Count & " comments in the worksheet.")
End Sub
private void GetCommentsCount()
{
    MessageBox.Show("Before adding a comment, there are " + 
        this.Comments.Count + " comments in the worksheet.");

    this.Range["A1", missing].AddComment("This is a comment for cell" +
        " A1");

    MessageBox.Show("After adding a comment, there are " + 
        this.Comments.Count + " comments in the worksheet.");
}

Seguridad de .NET Framework

Vea también

Referencia

WorksheetBase Clase

Microsoft.Office.Tools.Excel (Espacio de nombres)