XmlMappedRange.InsertIndent 方法

將縮排加入 XmlMappedRange 控制項中。

命名空間:  Microsoft.Office.Tools.Excel
組件:  Microsoft.Office.Tools.Excel (在 Microsoft.Office.Tools.Excel.dll 中)

語法

'宣告
Sub InsertIndent ( _
    InsertAmount As Integer _
)
void InsertIndent(
    int InsertAmount
)

參數

  • InsertAmount
    型別:System.Int32
    要加入到目前縮排的量。

備註

使用這個方法將縮排層級設為小於 0 (零) 或大於 15 的數字時,會產生錯誤。

使用IndentLevel 屬性會傳回範圍的縮排層級。

範例

下列程式碼範例使用 InsertIndent 方法,設定 XmlMappedRange 的縮排層級。 這個程式碼範例假設目前工作表包含名為 CustomerLastNameCell 的 XmlMappedRange

Private Sub AddIndent()
    Me.CustomerLastNameCell.Value2 = "Smith"
    Me.CustomerLastNameCell.InsertIndent(2)
End Sub
private void AddIndent()
{
    this.CustomerLastNameCell.Value2 = "Smith";
    this.CustomerLastNameCell.InsertIndent(2);
}

.NET Framework 安全性

請參閱

參考

XmlMappedRange 介面

Microsoft.Office.Tools.Excel 命名空間