map keyboard shortcuts to own macros

A

Anne

Hi!

My aim is to achieve that users are only able to delete
tasks in a way I defined.
In the command bar the command "delete task" can (as well
as any other command) be mapped onto a self-defined macro
in order to change the pre-defined behaviour.
Unfortunately the user is still able to use the key
shortcut to delete tasks by pressing the delete-key. To
prevent him from doing so I need to redirect the keyboard
shortcut (i.e. delete, backspace) to my own macro.
Is there a similar way to connect keys to another macro
like with commands?
Or are there alternative possibilities with Project events
(Project_change)?

Anne
 
D

DC

Below event oriented code written at the task level will
prevent deletion of tasks that have actuals reported
against it..

Private Sub ActiveApplication_ProjectBeforeTaskDelete
(ByVal tsk As Task, Cancel As Boolean)
'If a task has actuals, then dont allow delete.
If tsk.PercentWorkComplete > 0 Then
MsgBox "The task has actuals reported.Delete failed."
Cancel = True
End If
End Sub

Let me know if it helps..
DC
 
A

Anne

Thank you for your reply! Unfortunately it does not help.
I put the code at the same level as the Project events
(like Project_BeforeClose...) and it has no consequences
for my program.
I generally want to prevent the user from deleting task
independant if actuals were reported. Maybe you have
another suggestion?

Anne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top