Drag And Drop In Outlook Stuck At Hover

Hi, I’m trying to automate drag an drop in Outlook to move an email from a folder to another, I have a request that I do it with drag and drop no activities can be used. I used click down and the hover and click up as I saw in the tutorial, but for some reason it gets stuck in the hover and if I move the mouse a little bit it does it perfectly fine. Any ideas/suggestions?
Thank you

Hi @rdbogdan

Welcome back! :slight_smile:

Could you try this example:

With this workaround:

The workaround in that older case was to do a second DOWN click to make sure the element moves to the target area. It was a strange behaviour and I’m not sure if it applies for you, but if it does, it will solve the issue :slight_smile:

2 Likes

Doesn’t work, it keeps crashing and saying that the element cannot be found, my workaround that worked but the customer doesn’t actually like it is:


In this case even if I use hover or anything doesn’t return the error that I specified above.

If this worked, maybe re-attaching to the window will as well?

It doesn’t I’ve tried it, but the thing is that if I touch the mouse just a little it does what it should do, feels like it gets stuck or something like that.

I once had a situation where an element would not be recognized until I tried to look for it once. What I did then was to set a Try-Catch with a click activity, which I knew it will fail (so I set the timeout to 0 to fail immediately). I would then swallow that first exception and the very next ‘normal’ Click after that Try-Catch would click the element. Super weird, and I would hope it to be fixed by now, but might work as well?

Still the same error, the “1” click is in try catch, and the “2” is in the finally, it feels like it gets stuck or something, not sure if it’s a bug or whatCapture

Please still try to place the second click outside of the try catch with a small delay before it:

Please experiment with the delay value:
TimeSpan.FromMilliseconds(100)

Same thing, here are the clicks and delays maybe you can spot something I didn’t

Hi,
UI Automation is getting stuck in Outlook while a mouse button is pressed on the email list item, the UI thread is probably frozen. This behavior appears to be limited and specific to this part of Outlook, other areas in the application and other applications don’t lock.

As a workaround you can use: Right click on the email item > click on Move > click on Other Folder > double click on the needed folder

2 Likes

Thanks, I found a small workaround so it looks like drag and drop: first you select the mail, then you click down and use hover so it moves to the name of the sender and then to the desired folder. This worked for me as a workaround.

1 Like

Hi @loginerror This worked for me. Thanks for suggestions.

1 Like