views:

661

answers:

1

This is a quiestion concerning both, Adobe AIR and MS Outlook.

I'd like to drag an eMail from Outlook into an AIR application. I want the following data to be transferred into the AIR application:

  • unique ID of the mail in Outlook to create a link into Outlook
  • rich text of the mail
  • some information about the mail like sender, recepient, date etc.

Some windows applications do this, like My Life Organized or Linker. Is this possible in any way for AIR? I'm pretty sure I need not only the AIR application but also some windows app or Outlook plugin to achieve this. Any ideas?

+5  A: 
  • Basically you listen to NativeDragEvent.NATIVE_DRAG_ENTER, NATIVE_DRAG_DROP and NATIVE_DRAG_EXIT on the UI element that will receive the drop.
  • All three of these events are raised with a NativeDragEvent, through which you can access data in various formats via event.clipboard.getData(), passing in a format specified by ClipboardFormats (eg. ClipboardFormats.FILE_LIST_FORMAT)
  • In NATIVE_DRAG_ENTER, you can accept/reject the drag operation via the static methods on NativeDragManager

The classes you need are all in the flash.desktop package. Just experiment with various ClipboardFormats until you see the data you need.

Richard Szalay
Drag'n'Drop into an AIR application is no problem, just works fine as you described. But have you tried to drag an eMail from Outlook into AIR? It only contains one line showing sender and date etc. As mentioned in the question: I'm pretty sure something has to be one on both sides.
Stefan Henze
It's quite likely that Outlook is adding extra data into a "Clipboard Format" that AIR will not allow you to access. My only advise is to check available data in each of the ClipboardFormats values and see what comes out. Failing that, you're probably out of luck.
Richard Szalay