OutlDD - Drag and Drop from Outlook to Java

Abstract

OutlDD enables Java programs to make use of the special Micosoft Outlook drag&drop data format. It can be used with Java 1.8 to 21.0 on Microsoft Windows (7 to 11) and Microsoft Outlook 2003 to 2016.

How does it Work?

On Microsoft Windows, drag&drop information is passed in an IDataObject from the sender to the receiver. This object can contain several data types like bitmap, text, file name etc. Many of this types are known by the Java AWT/SWT/Swing/JavaFX. But the format used by Microsoft Outlook when dragging mails is not implemented.

Because the AWT does not provide access to the underlying IDataObject, there is no way to add this functionality in pure Java. Thus, JNI code is required, to achieve mail drag&drop.

OutlDD intercepts the IDataObject of the drag&drop operation and either replaces the IDataObject by a "simpler" one or gives the Java program access to its contents by means of JNI function calls.

In the former case, the dragged mails are copied into the temporary directory and a new IDataObject with file-drop information for this temporary files is passed to the AWT. From the view of the AWT, it seems to be an ordinary file-drop operation and existing Java drag&drop logic does not need to be changed. This operation mode is called MODE_TEMP_FILES.

In the latter case, which is called MODE_MEMORY_STREAM, OutlDD functions allow Java code to access the underlying IDataObject directly. This allows the programmer e.g. to receive the mail data as an java.io.InputStream or display a hourglass when many files are dropped.

Example

Start OutlDD example.jnlp