捲動到一個資源、任務或日期。
expression. EditGoTo
( _ID_
, _Date_
)
expression 代表 Application 物件的變數。
名稱 | 必要/選用 | 資料類型 | 描述 |
---|---|---|---|
ID | 選用 | Long | 會指定要顯示在使用中窗格之任務或資源識別碼的編號。 |
Date | 選用 | Variant | 會指定要顯示在使用中窗格的第一個日期的數字或字串。 |
布林值
下面範例提示使用者輸入日期或任務名稱,然後在使用中窗格捲動到該日期或任務。 假定使用者在任務檢視中。
Sub PromptUserForEditGotoArguments()
Dim Entry As String ' Date or task name entered by user
Entry = InputBox$("Enter a date or a task name to which you want to scroll in the active pane.")
' If user enters a date, scroll to a date in the active pane.
If IsDate(Entry) Then
EditGoTo Date:=Entry
' Otherwise, scroll to a task in the active pane.
Else
EditGoTo ID:=ActiveProject.Tasks(Entry).ID
End If
End Sub
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。