Solved

Drag and Drop message from Outlook Express or Outlook?

Posted on 2001-09-13
12
784 Views
Last Modified: 2007-12-19
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?



0
Comment
Question by:kuzub
12 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6481062
Interesting...
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6493291
<listening but NO one post comment here..>
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6493937
Well, let us start then...
Which is the target control?
0
 
LVL 1

Author Comment

by:kuzub
ID: 6494135
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'




0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6494581
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.
0
 
LVL 1

Author Comment

by:kuzub
ID: 6495696
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!).
 




0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 200 total points
ID: 6496517
Constant vbCFText = 1

I did a little trick to know which type of data is comming to treeview, could do you a try?


Drag you message to treeview and see debug/inmediate window:

Private Sub TreeView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer,
Shift As Integer, x As Single, y As Single)
dim idx as long
for idx=1 to 9      ' supported formats: 1,2,3,8,9,&HBF00
    debug.print i & ": " &Data.Getformat(idx)
next idx
debug.print  "Link: " &Data.Getformat(&HBF00)

End Sub
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6497779
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:

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6497787
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6497798
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7208371
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
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7241196
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now