Link to home
Start Free TrialLog in
Avatar of kuzub
kuzub

asked on

Drag and Drop message from Outlook Express or Outlook?

I want drag and drop message with attachments! from Outlook Express in my application.
But in events OLEDragDrop i receive only text message (in one string variable From:, To:, Date:, Subject: and Body) and without attachments.

How to receive full message from DataObject?



Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Interesting...
<listening but NO one post comment here..>
Well, let us start then...
Which is the target control?
Avatar of kuzub
kuzub

ASKER

Target Control - TreeView.

I tested Drag and Drop one message from Outlook Express 6.0 and Outlook 2000.
And I receive different string variable.
Example
For Outlook Express   From: NikName <email@.....>
For Outlook 2000 Only From

And if I drag and drop  message which contain HTML
i receive VB error  message 'Method 'GetData' of object 'IVBDataObject' failed'




With outlook express:

Private Sub TreeView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)

MsgBox Data.GetData(1)
End Sub

i got all text from: "from" to end of message.
I can't try with attachs since i haven't any msg with them.
Avatar of kuzub

ASKER

But my questions about attachments.

Example:
Drag and drop message from Outlook Express to Explorer ->
I receive in  Explorer *.eml file.
 
Drag and drop message from Outlook 2000 to Explorer ->
I receive in  Explorer *.msg file.

Its files have full information about message.
And it i can load with the help CDO and save in database.

Now i use
If Data.GetFormat(vbCFText) Then
iMsg=Data.GetData(vbCFText)

But from iMsg I can not receive the all information, necessary to me (attachments!).
 




ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What happens here is:
When you drag msg from Outlook Express to Explorer, you got and .eml file,right?
But.... if you open that file with a text editor, you will get only text!
The attachment is there but in text format encoded with base64 (i think) algorythm. If you want the attachment, you need to decode yourself or you will get nothing.

These are links to base64 tools:

Hi kuzub,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Richie_Simonetti's comment(s) as an answer.

kuzub, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted.

Netminder
CS Moderator