
Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
|
07.04.2009, 16:03
|
|||
|---|---|---|---|
|
|||
Не происходит событие |
|||
|
#18+
Добрый день, коллеги! Проблема такая: пытаюсь поймать событие ProjectBeforeTaskChange в MSProject2003, а оно что-то не ловится))). Делаю как в справке написано, т.е. по следующему списку 1. In Project’s Microsoft Visual Basic window, click Insert - Class Module. 2. Rename the module to “AppEvents” by selecting the new class module and changing the name in the Properties window. (If the Properties window is not visible, you can turn it on in the View menu.) 3. Add the line of code “Public WithEvents ProjApp as Application” to the class module. This declares the class as a project application and the application can trigger events. 4. Change the object to ProjApp from (General) in the top left dropdown. 5. Select the application event in the top right dropdown. For example, ProjApp_ProjectBeforeTaskChange. 6. Add code to the procedure. For example, the following code alerts the user if they are using a poor task naming convention by using the word “task” in the task’s name. Private Sub ProjApp_ProjectBeforeTaskChange(ByVal tsk As Task, _ ByVal Field As PjField, ByVal NewVal As Variant, Cancel As Boolean) MsgBox "123" End Sub 7. Change to the appropriate code module, such as ThisProject(MyProject), by double-clicking the module in the Project Explorer window (usually in the top left). 8. Add “Dim myApp As New AppEvents” to the top of the module. This references the class and its events. 9. Set the myApp variable’s ProjApp property equal to the project application object by using the following code: Private Sub Project_Open(ByVal pj As Project) Set myApp.ProjApp = Application End Sub 10. You can add the above code to the Global.mpt or the Enterprise Global instead of the project plan. This code must run prior to using the events. You may have to run the code manually at the beginning of testing since the open event will not run until you save, close, and open the project plan. Все сохраняется без ошибок, но при изменении задачи событие не возникает. Может у кого есть какие мысли. Заранее благодарен за ответы. P.S. Опыта работы с MSProject и VB нет. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|

start [/forum/topic.php?fid=60&mobile=1&tid=2161164]: |
0ms |
get settings: |
12ms |
get forum list: |
19ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
64ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
34ms |
get tp. blocked users: |
1ms |
| others: | 283ms |
| total: | 432ms |

| 0 / 0 |
