Q
Qk11bms
This works when the task is opened in a window (Inspector).
How is it possible to get an event when the task status is changed with
"in-cell edits" enabled? There you don't have the inspector opened.
Thanks!
"Alan Moseley" wrote:
> Put the following code into your ThisOutlookSession code window. It will
> work when the task is opened and then completed:-
> Dim WithEvents myInspectors As Inspectors
> Dim WithEvents myTaskItem As TaskItem
> Private Sub Application_Startup()
> Set myInspectors = Outlook.Inspectors
> End Sub
> Private Sub myInspectors_NewInspector(ByVal Inspector As Inspector)
> If TypeName(Inspector.CurrentItem) = "TaskItem" Then
> Set myTaskItem = Inspector.CurrentItem
> End If
> End Sub
> Private Sub myTaskItem_Close(Cancel As Boolean)
> Set myTaskItem = Nothing
> End Sub
> Private Sub myTaskItem_PropertyChange(ByVal Name As String)
> If Name = "Status" Then
> If myTaskItem.Complete = True Then
> MsgBox "Task " & myTaskItem.Subject & " now completed"
> End If
> End If
> End Sub
> Obviously replace the messagebox with your required code.
> > Alan Moseley IT Consultancy
> http://www.amitc.co.uk
> If I have solved your problem, please click Yes below. Thanks.
> "Mark" wrote:
>
> > I would like to be able to execute some code when the user changes the status
> > of a task from "Not Started" to "Complete"
> > Any help would be appreciated
> > Mark
How is it possible to get an event when the task status is changed with
"in-cell edits" enabled? There you don't have the inspector opened.
Thanks!
"Alan Moseley" wrote:
> Put the following code into your ThisOutlookSession code window. It will
> work when the task is opened and then completed:-
> Dim WithEvents myInspectors As Inspectors
> Dim WithEvents myTaskItem As TaskItem
> Private Sub Application_Startup()
> Set myInspectors = Outlook.Inspectors
> End Sub
> Private Sub myInspectors_NewInspector(ByVal Inspector As Inspector)
> If TypeName(Inspector.CurrentItem) = "TaskItem" Then
> Set myTaskItem = Inspector.CurrentItem
> End If
> End Sub
> Private Sub myTaskItem_Close(Cancel As Boolean)
> Set myTaskItem = Nothing
> End Sub
> Private Sub myTaskItem_PropertyChange(ByVal Name As String)
> If Name = "Status" Then
> If myTaskItem.Complete = True Then
> MsgBox "Task " & myTaskItem.Subject & " now completed"
> End If
> End If
> End Sub
> Obviously replace the messagebox with your required code.
> > Alan Moseley IT Consultancy
> http://www.amitc.co.uk
> If I have solved your problem, please click Yes below. Thanks.
> "Mark" wrote:
>
> > I would like to be able to execute some code when the user changes the status
> > of a task from "Not Started" to "Complete"
> > Any help would be appreciated
> > Mark