XmlMappedRange.CurrentRegion 属性

获取一个表示当前区域的 Range

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

语法

声明
ReadOnly Property CurrentRegion As Range
    Get
Range CurrentRegion { get; }

属性值

类型:Microsoft.Office.Interop.Excel.Range
一个表示当前区域的 Range

备注

当前的区域是由任意组合的空行和空列所包围的范围。

此属性不能在受保护的工作表上使用。

示例

下面的代码示例使用 CurrentRegion 属性将 XmlMappedRange 内部区域的颜色设置为绿色。 此代码示例假定当前工作表包含一个名为 CustomerLastNameCell 的 XmlMappedRange

Private Sub ColorCurrentRegion()
    ' Set the color of the region to the RGB value for green.
    Me.CustomerLastNameCell.CurrentRegion.Interior.Color = &HFF00
End Sub
private void ColorCurrentRegion()
{
    // Set the color of the region to the RGB value for green.
    this.CustomerLastNameCell.CurrentRegion.Interior.Color = 0xFF00;
}

.NET Framework 安全性

请参见

参考

XmlMappedRange 接口

Microsoft.Office.Tools.Excel 命名空间