h
I need to be able to detect the user changing Appointments in the Calendar. Generally I'm using the Explorer_SelectionChange() event to detect that the user has selected an Item, and then the Item_Write() event to detect that a change has been made to that selected Item. Generally this works fine, but when the User *drags and drops* an Appointment, the SelectionChange event doesn't fire until the "drop", which must be immediately before the Item_Write fires - because my VB app only picks up the SelectionChange and ignores the Item_Write. NB at this point no Item is actually Selected, so I can't detect which Item was moved in Explorer_SelectionChange()
One way round this would be to lose the Explorer_SelectionChange() event altogether from my Code which I guess would mean that the Item_Write event would be detectable - but I'm relying on the Explorer_SelectionChange() event to get a handle on the Item being selected for editing..
Any suggestions most welcome!
David Kane - 30 Dec 2003 04:51 GMT
Andy,
You can declare a variable as the collection of Calendar items (WithEvents):
Private WithEvents colCalendarItems As Outlook.Items
Instantiate the collection when your session starts and then trap the colCalendarItems_ItemChange() event, which will give you each changed item, including drag/drops
----- AndyK wrote: -----
hi
I need to be able to detect the user changing Appointments in the Calendar. Generally I'm using the Explorer_SelectionChange() event to detect that the user has selected an Item, and then the Item_Write() event to detect that a change has been made to that selected Item. Generally this works fine, but when the User *drags and drops* an Appointment, the SelectionChange event doesn't fire until the "drop", which must be immediately before the Item_Write fires - because my VB app only picks up the SelectionChange and ignores the Item_Write. NB at this point no Item is actually Selected, so I can't detect which Item was moved in Explorer_SelectionChange().
One way round this would be to lose the Explorer_SelectionChange() event altogether from my Code which I guess would mean that the Item_Write event would be detectable - but I'm relying on the Explorer_SelectionChange() event to get a handle on the Item being selected for editing...
Any suggestions most welcome!
AndyK - 30 Dec 2003 06:56 GMT
hi David - thanks for replyin
Sorry I should have said that I use Item_Write because I need to validate the changed Item and backout the change if invalid. The Cancel facility in Item_Write lets me do that backout - and I don't believe Items_ItemChange lets me do that
thanks for any further help you can provide...