Project) (Application.BoxCellEdit 方法
設定網狀圖檢視 (PERT 圖) 的資料範本中個別儲存格的屬性。
語法
expression。 BoxCellEdit
( _Name_
, _Cell_
, _FieldName_
, _Font_
, _FontSize_
, _FontColor_
, _Bold_
, _Italic_
, _Underline_
, _HorizontalAlignment_
, _VerticalAlignment_
, _TextLineLimit_
, _ShowLabel_
, _Label_
, _DateFormat_
)
expression 代表 Application 物件的變數。
參數
名稱 | 必要/選用 | 資料類型 | 描述 |
---|---|---|---|
Name | 必要 | String | 含有要編輯之儲存格的資料範本的名稱。 |
Cell | 必要 | Long | 要編輯的儲存格。 這可以是 PjCell 常數之一。 |
FieldName | 選用 | Long | 要顯示在儲存格中之欄位的名稱。 可以為其中一個 PjField 常數。 |
Font | 選用 | String | 字型的名稱。 |
FontSize | 選用 | Integer | 字型的大小,以點為單位。 |
FontColor | 選用 | Long | 字型的色彩。 可以為其中一個 PjColor 常數。 |
Bold | 選用 | 布林值 | True 是表示 如果字型是粗體;否則 為 False 。 |
Italic | 選用 | 布林值 | True 是表示 如果字型是斜體格式 ;否則 為 False 。 |
Underline | 選用 | 布林值 | True 是表示 如果字型有加底線;否則 為 False 。 |
HorizontalAlignment | 選用 | Long | 會指定儲存格中,文字的水平對齊方式。 這可以是 PjAlignment 常數之一。 |
VerticalAlignment | 選用 | Long | 會指定儲存格中,文字的垂直對齊方式。 這可以是 PjVerticalAlignment 常數之一。 |
TextLineLimit | 選用 | Long | 會指定儲存格中,文字行數的限制。 值可以是 1、2 或 3。 |
ShowLabel | 選用 | 布林值 | True 是表示 如果標籤顯示在儲存格中;否則 為 False 。 |
Label | 選用 | String | 指定儲存格標籤。 |
DateFormat | 選用 | Long | FieldName 時的日期欄位指定之儲存格的日期格式。 可以是下列 PjDateFormat 常數之一。 |
傳回值
布林值
註解
若只搭配 Name 和 Cell 引數來使用 BoxCellEdit 方法,此方法會沒有作用。
若要編輯其文字色彩可以是 RGB 值的資料範本儲存格,請使用 BoxCellEditEx 方法。
範例
下列範例會修改一份名為 Test Critical 的 [要徑] 資料範本。 巨集會移除第四列儲存格,然後設定第三列中的第四個儲存格顯示 [實際成本] 欄位,並以綠色文字標示。
Sub ModifyCriticalDataTemplate()
Application.BoxCellLayout Name:="Test Critical", CellRows:=3, MergeCells:=True
Application.BoxCellEdit Name:="Test Critical", Cell:=pjCell4_3, _
FieldName:=PjField.pjTaskActualCost, Font:="Arial", FontSize:="8", FontColor:=PjColor.pjGreen, _
Bold:=False, Italic:=False, Underline:=False, HorizontalAlignment:=pjLeft, _
VerticalAlignment:=pjMiddle, TextLineLimit:=1, ShowLabel:=True, Label:="Cost"
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。