XmlMappedRange.AddComment 方法

将一条注释添加到 XmlMappedRange 控件中。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
Function AddComment ( _
    Text As Object _
) As Comment
Comment AddComment(
    Object Text
)

参数

返回值

类型:Microsoft.Office.Interop.Excel.Comment
添加到 XmlMappedRange 控件的注释。

备注

可选参数

有关可选参数的信息,请参见Office 解决方案中的可选参数

示例

下面的代码示例使用 AddComment 方法将一条注释添加到名为 CustomerLastNameCell 的 XmlMappedRange 中,然后使用 Comment 属性改变注释文本。 此代码示例假定当前工作表包含一个名为 CustomerLastNameCell 的 XmlMappedRange

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

.NET Framework 安全性

请参见

参考

XmlMappedRange 接口

Microsoft.Office.Tools.Excel 命名空间