Partager via


XmlMappedRange.AddComment, méthode

Ajoute un commentaire au contrôle XmlMappedRange.

Espace de noms :  Microsoft.Office.Tools.Excel
Assembly :  Microsoft.Office.Tools.Excel (dans Microsoft.Office.Tools.Excel.dll)

Syntaxe

'Déclaration
Function AddComment ( _
    Text As Object _
) As Comment
Comment AddComment(
    Object Text
)

Paramètres

Valeur de retour

Type : Microsoft.Office.Interop.Excel.Comment
Commentaire ajouté au contrôle XmlMappedRange.

Notes

Paramètres optionnels

Pour plus d'informations sur les paramètres optionnels, consultez Paramètres optionnels dans les solutions Office.

Exemples

L'exemple de code suivant utilise la méthode AddComment pour ajouter un commentaire à un contrôle XmlMappedRange appelé CustomerLastNameCell, puis utilise la propriété Comment pour modifier le texte de commentaire. Cet exemple de code suppose que la feuille de calcul active contient un contrôle XmlMappedRange nommé CustomerLastNameCell.

Private Sub AddComment()
    Me.CustomerLastNameCell.AddComment("Text to be replaced.")
    Me.CustomerLastNameCell.Comment.Text( _
        "This range contains customer last names.")
End Sub
private void AddComment()
{
    this.CustomerLastNameCell.AddComment("Text to be replaced.");
    this.CustomerLastNameCell.Comment.Text(
        "This range contains customer last names.", 
        missing, missing);
}

Sécurité .NET Framework

Voir aussi

Référence

XmlMappedRange Interface

Microsoft.Office.Tools.Excel, espace de noms