Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag and Drop E-mail from Outlook to Listbox

Status
Not open for further replies.

Kaiserr2

IS-IT--Management
Jan 27, 2003
9
0
0
CA
Does anyone have any idea of how to drag an e-mail from Outlook or Outllok Express over a list box in a VB application and copy the .msg file into the listbox?

Are there any Active X controls that would support that kind of operation?
 
Never found a way how to do it.

The closest thing I could find was to drag and drop the message on to the desktop - and then from windows explorer drag and drop it into the list box. From there you had one or two options:

Option one was to actually copy the file itself and the other option was to copy the text from the email.
 
Start a new VB project. Put a textbox on your form and set its properties as under.

[tt]MultiLine = True
OLEDropMode = 1[/tt] (Manual)

Put the following code in your form.
___
[tt]
Private Sub Form_Resize()
Text1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub

Private Sub Text1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Data.GetFormat(vbCFText) Then Text1 = Data.GetData(vbCFText)
End Sub[/tt]
___

Now run the program and drag-drop a message from Outlook to your textbox, the contents of the message will be captured directly in the textbox.

Checked with Outlook Express and its working fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top