Share via


WorksheetBase.StandardWidth 屬性

取得或設定工作表中所有欄的標準 (預設) 寬度。

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

語法

'宣告
Public Property StandardWidth As Double
public double StandardWidth { get; set; }

屬性值

型別:System.Double
工作表中所有欄的標準 (預設) 寬度。

備註

一個單位的欄寬等於「內文」樣式中一個字元的寬度。 如為調和字型,則使用的字元寬度為 0 (零)。

範例

下列程式碼範例會使用 StandardWidth 屬性,顯示目前工作表中所有欄的預設寬度。

這是示範文件層級自訂的範例。

Private Sub DisplayStandardWidth()
    MsgBox("The default column width is " & _
        Me.StandardWidth.ToString() & " characters.")
End Sub
private void DisplayStandardWidth()
{
    MessageBox.Show("The default column width is " +
        this.StandardWidth.ToString() + " characters.");
}

.NET Framework 安全性

請參閱

參考

WorksheetBase 類別

Microsoft.Office.Tools.Excel 命名空間