Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / December 2003

Tip: Looking for answers? Try searching our database.

Problem detecting "Drag and Drop" of Appointment Item

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AndyK - 29 Dec 2003 17:01 GMT
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...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.