none
How to catch dragging of appointment-item without selecting it first RRS feed

  • Question

  • I handle the Explorer SelectionChange event to determine what item a user is dragging

    As far as I can tell:

    ·         Click –Mouse up-Click-Drag fires the event

    ·         Click –Drag does NOT fire the event

    How can I deal with the Click-Drag scenario?

    Saturday, March 24, 2018 4:52 PM

All replies

  • You would need to process drag/drop data from Outlook. One of the formats (none of them documented) includes the entry ids of the messages being dragged. Use a utility like ClipSpy to look at the data


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Saturday, March 24, 2018 5:08 PM
  • When the user click-mouse up - the SelectionChange event fires

    In my event handler I set an Appointment variable and wire up the Appointment variable's  Write and PropertyChanged events, because there are some actions I need to take when these are raised.

    In Outlook without MSE - I can easily set my Appointment variable in my code within the Explorer BeforePaste event (which is raised as part of a drag and Drop) so  and wire up the Write and PropertyChanged events

    When the Appointment  Write event is handled in my code I Find one of my UserPoperties of the Appointment variable to check its value

    ALL THIS WORKS fine in Outlook without MSE, but raises an Exception in Outlook-MSE when the

    Appointment.UserProperties.Find() 
    function is called

    Saturday, March 24, 2018 5:18 PM
  • Hello,

    >>Click –Drag does NOT fire the event

    Do you mean clicking and dragging the appointment directly? I failed to reproduce this in outlook 2016. Whether I mouse up and then click and drag the appointment or click and drag the appointment directly could both fire the event for me. What's the version of your office? What's the purpose of firing the event?

    >>ALL THIS WORKS fine in Outlook without MSE, but raises an Exception in Outlook-MSE when the

    We would suggest you post one thread for one issue. Is it related to your original issue? If yes, please detail the relationships. If not, please post a new thread for it.

    Thanks for understanding.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 26, 2018 7:24 AM
  • Thanks Terry

    Office 2016 stand alone on my PC

    Explorer SelectionChange event

    In my event handler for this I inspect the Selection and check if it is an Appointment and if so if it has my User Properties

    Monday, March 26, 2018 2:17 PM
  • Apologies

    My standalone Outlook is Outlook 2013

    Monday, March 26, 2018 2:47 PM
  • Hello AdrewBinghamTBSPCL,

    For the thread original issue, " Click –Drag does NOT fire the event", is it resolved?

    If so, please mark helpful reply or you could also provide your solution and mark it to close the thread.

    For other issue, please post a new thread for it.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 28, 2018 9:21 AM
  • Hi Terry

    No - not resolved

    Wednesday, March 28, 2018 10:37 AM
  • BeforePaste event does not fire during drag/drop - you can see that in OutlookSpy (click Explorer button, go to the Events tab, look at the log at the bottom of the page).

    Where are you dragging the items? Your own form?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, March 28, 2018 1:57 PM
  • @Dmitry

    Really?

    Explorer BeforePaste is definitely raised during a drag and drop - specifically .... before the dragged item is pasted

    I have been using this event for a few years !!


    Wednesday, March 28, 2018 2:18 PM
  • Again, where are you dragging the items? It is certainly not raised when dragging to Windows Explorer - check for yourself.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, March 28, 2018 2:43 PM
  • Dragging Appointments between Calendars

    Dragging outside Outlook could not call the Explorer BeforePaste event

    Wednesday, March 28, 2018 2:46 PM
  • If you are dropping on a folder, why not use Items.ItemAdd event on that folder?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, March 28, 2018 3:41 PM
  • The Appointments are created from a database - storing some database values in an Outlook Appointment Item UserProperties

    These values are used in a Form Region and also to determine and restrict the outcome of certain User actions

    The Calendars are created by the Add-In under the MSE Public Folder 

    When an Appointment is dragged and dropped between Calendars the normal Outlook behaviour is to COPY the Appointment. This behaviour can be modified by a User by holding down SHIFT or CTRL keys (similar to Windows File Explorer). 

    These Appointments MUST NOT be copied - they must only be MOVED between Calendars

    Furthermore - these Appointments can only be moved between Calendars in the Public Folder

    Finally - moving an Appointment updates the database and may also update one other of these Appointments (If it exists)

    HENCE the need to intercept before the Appointment is pasted - and ensure the above requirements are met

    Wednesday, March 28, 2018 3:57 PM