Am 8 Oct 2005 05:01:30 -0700 schrieb vonclausowitz@gmail.com:
I´m not sure what you´re asking for. You don´t have to reference each item
at once. You need a reference on each opened TaskItem and one on the
currently selected TaskItem (if any) in each opened Explorer. In that way
you´re able to track each TaskItem´s events, which an user could edit.
Please see also the VBA help. There´re samples for all mentioned events:
NewInspector, PropertyChange, SelectionChange.
For one TaskItem in an Explorer the code looks like this:
Private WithEvents m_oTask as Outlook.TaskItem
Private WithEvents m_oExplorer As Outlook.Explorer
Private Sub Application_Startup()
Set m_oExplorer = Application.ActiveExplorer
End Sub
Private Sub m_oExplorer_SelectionChange()
If m_oExplorer.CurrentFolder.DefaultItemType = olTaskItem Then
Set m_oTask = m_oExplorer.Selection(1)
End If
End Sub
Private Sub m_oTask_PropertyChange(ByVal Name As String)
If Name="Complete" Then
If m_oTask.Complete=True Then
' ...
Endif
Endif
End Sub

Signature
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
> Wooh,
>
[quoted text clipped - 6 lines]
>
> Marco
vonclausowitz@gmail.com - 08 Oct 2005 18:55 GMT
Michael,
When trying this code I get an error message saying:
"Array index out of bounds" on the next lines:
Private Sub oExplorer_SelectionChange()
If oExplorer.CurrentFolder.DefaultItemType = olTaskItem Then
----->> error ---> Set oTask = oExplorer.Selection(1)
End If
End Sub
Michael Bauer - 08 Oct 2005 19:25 GMT
Am 8 Oct 2005 10:55:58 -0700 schrieb vonclausowitz@gmail.com:
That means there´s no item selected. You can check Selection.Count
before accessing Selection(1).

Signature
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
> Michael,
>
[quoted text clipped - 9 lines]
>
> End Sub