Problem detecting "Drag and Drop" of Appointment Item

G

Guest

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!
 
G

Guest

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!
 
G

Guest

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...
 

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