Disable control CTRL button when dragging items/folders - Outlook

N

Nabil

Hi,

I'm currently developing an Outlook 2007 addin using VSTO. I don't want
users to be able to drag items/folders pressing the CTRL key at the same
time.

The default action when users drag items in the same store is to move the
items, if the user presses CTRL at the same time then the action changes to
COPY which I don't want.

Does anyone know how to disable this?

I've already had a look at disabling shortcut keys but didn't have any
effect. http://technet.microsoft.com/en-us/library/cc179143.aspx


Thanks in advance

Nabil
 
E

Eric Legault [MVP - Outlook]

You can't disable it, but you can cancel this action before it is committed.
If you trap the BeforeItemCopy/Paste events for the Explorer object, you can
set the Cancel argument to true. However, you can't do the same for a folder
move operation without trapping multiple Folders.FolderRemove events - and
even then you can't cancel it (although you can probably undo it in code).

There may be some other trickery you can do, but I doubt there's a clean
approach to solving this.
 
N

Nabil

Thank you Eric,

I had already tried BeforeItemCopy before which doesn't fire when copying
items with the control key. I thought I have hit another dead end but then I
read the rest of your post and I tried BeforeItemPaste which I hadn't
considered before but works fantastically.

BeforeItemPaste fires consistently when you copy items with the Control Key
down so that is what I'm going to use.

I'll hack my way round the folder problem.

Once again, thank you very much for your help!

Nabil
 

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