Well, I think I am about to give up on this. The following code only works if the user has clicked the attachment in the Email before dragging it over (it is visible in the Email). ActiveExplorer.AttachmentSelection.Count returns zero if you start dragging the attachment before clicking it first. The other issue is once the attachment has been selected then the count will always be greater than zero regardless of it being visible in the Email or not. This means they cannot go back and start dragging the Email until then have clicked off of it and then back on to clear the count.
ll_selected_outlook_count = lole_OutlookApp.ActiveExplorer.AttachmentSelection.Count
IF ll_selected_outlook_count > 0 THEN
FOR llNdx = 1 to ll_selected_outlook_count
ls = lole_OutlookApp.ActiveExplorer.AttachmentSelection.item(llNdx).FileName
NEXT
END IF
I have read many posts about this issue with other developers. The one solution that someone provided was to use the FileGroupDescriptor from the IDataObject ( Outlook Drag and Drop in C# - CodeProject ) but I have been unsuccessful in getting that to work in PowerBuilder.
I think I am all fished out for now. If anyone finds out how to do this please let me know!
Chris Craft