Megosztás a következőn keresztül:


Worksheet.Comments Property (2007 System)

Gets a Comments collection that represents all the comments for the worksheet.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Comments As Comments
'Usage
Dim instance As Worksheet 
Dim value As Comments 

value = instance.Comments
[BrowsableAttribute(false)]
public Comments Comments { get; }
[BrowsableAttribute(false)]
public:
property Comments^ Comments {
    Comments^ get ();
}
public function get Comments () : Comments

Property Value

Type: Comments
A Comments collection that represents all the comments for the worksheet.

Examples

The following code example uses the Comments property to display the number of comments on the current worksheet before and after adding a comment to cell A1.

This example is for a document-level customization.

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.");
}

.NET Framework Security

See Also

Reference

Worksheet Class

Worksheet Members

Microsoft.Office.Tools.Excel Namespace