Application.EditGoTo 方法 (Project)
滚动到某个资源、任务或日期。
语法
expression. EditGoTo
( _ID_
, _Date_
)
expression:表示 Application 对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
ID | 可选 | Long | 一个数字,用于指定要显示在活动窗格中的任务或资源标识号。 |
Date | 可选 | Variant | 一个数字或字符串,用于指定要显示在活动窗格中的第一个日期。 |
返回值
Boolean
示例
以下示例将提示用户输入日期或任务名,然后在活动窗格中滚动到该日期或任务。 此示例假定用户处于任务视图中。
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 支持和反馈,获取有关如何接收支持和提供反馈的指南。