How to Drag and Drop email message into VB app.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a VB6 app and I want to 'drag and drop' the reference to an email that
resides in Outlook.

I do NOT want to store the email's contents in my app just the reference to
it. I guess it's like Object Linking (not embedding).
 
Tom, if your app receives the OLEDragDrop then the DataObject contains
only some text. This is controlled by OL and can´t be changed. If the
operation started from Outlook then it´s clear that the selected items
are dragged. These items you can get with (Outlook)
Application.ActiveExplorer.Selection.
 
Yes the operation did start from Outlook.

Sorry but I do not know what you mean by:
"These items you can get with (Outlook) Application.ActiveExplorer.Selection."

Do you mean I can get the 'link' to the items using above from VB?
 
Thomas, please add a reference on Outlook to your project. Then you can
see Outlook´s object modell via the Object Browser (F2, then switch from
<All Libraries> to Outlook).

The Selection collection (huh, what a term :-) contains references to
all currently selected items in Outlook. This refs you´d need to get
because Outlook´s Drag&Drop mechanism doesn´t provide you with them.

Sample, called from within your DragDrop event:

Dim oApp as Outlook.Application
Dim colSel as Outlook.Selection

Set oApp=GetObject(,"Outlook.Application")
Set colSel=oApp.ActiveExplorer.Selection
 
thanks a lot for this hint! finally, this workarround helped me to realize
drag&drop from outlook to my application.

there is one issue, i didn't find a solution for since yet: it doesn't work
with advanced search results. i couldn't any reference to the active advanced
search results. does somebody know, how to fix this problem?

thanks, josef dabernig
 
hello michael!

building my own advanced search dialog sounds ... hard.
did you mean, that there is no possibility to access advanced search results?

josef
 
Am Fri, 29 Jul 2005 00:29:02 -0700 schrieb josef dabernig:

Hi Josef,

you can access the results if you start the search by code. Another way
would be to use the data, provided by Drag&Drop, and search the message
in the folder.
 
this is great, but what if I have outlook open and somoene drops
something from, say, some other program onto this control? Do I have
any way of knowing the source of the Data object is from Outlook?

Thanks,
kevin
 
Am Wed, 17 Aug 2005 19:36:18 -0700 schrieb kevin rusch:

Kevin, there may be other ways. This is the one I know: With some Win32
APIs you can get the active application´s ProcessID and compare with
Outlook´s current ProcessID. If it´s the same then Outlook has the focus
and the operation must have started in Outlook.

Maybe I´ll find the time to work out an example this weekend. But I
don´t want to promise that.

You can search yourself for some hints, of course. A few keywords are
GetForegroundWindow and GetWindowThreadProcessId.
 
Back
Top