Need Better Approach or Third Party Control for Drag/Drop 
Author Message
 Need Better Approach or Third Party Control for Drag/Drop

Using the sub below, I can trap a couple of things:

1) In the case of an email dragged from Outlook and dropped onto the
control, I can trap what appears to be a binary string containing the
description of an email that I would imagine I can feed to an Outlook object
somehow.
2) In the case of a file from an Explorer window, I can trap a file name.

I am wondering two things:

1) Typically, does one have to trap the data from the drag and drop, analyze
it to find out what type of data it is, and then act on that knowledge, or
does anyone know of third party controls/code that might handle typical drag
and drop data?
2) in the case of files, the Data object does not appear to have a method or
property to tell me how many files have been dragged/dropped.  Do I have to
trap error 9 to find out the index is out of bounds and that I am done
retrieving files?

Code below.

Thanks,

Michael

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

Dim myText As String
Dim myText2 As String

    If Data.GetFormat(vbCFText) Then
        myText = Data.GetData(vbCFText)
    End If
    If Data.GetFormat(vbCFFiles) Then
        myText = Data.Files(1)
        myText2 = Data.Files(2)
    End If

End Sub



Tue, 25 Oct 2005 03:33:47 GMT  
 Need Better Approach or Third Party Control for Drag/Drop
For your first question, I am afraid that VB doesn't support all the data
formats. For example it doesn't support outlook mail attachments. I am not
sure if there is any 3rd party contorl on this.

For your second question, the you can use For Each to enumerate all the
itmes in the the Data.Files collecttion.

HTH

David Yuan [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Got .Net?  http://www.gotdotnet.com".  



Tue, 25 Oct 2005 17:08:53 GMT  
 Need Better Approach or Third Party Control for Drag/Drop
Another idea with drag and drop with Outlook mail item. When you receive a
mail item dragged from Outlook, you can get the mail item's subject and
other information. I believe that you can use this information to automate
Outlook, and to get the get the rest of the message information. Below is a
KB article about how to manipulate with the main items in Outlook with
Automation:

http://support.microsoft.com/?id=290804

David Yuan [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Got .Net?  http://www.gotdotnet.com".  



Sat, 29 Oct 2005 20:33:22 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. I need to know how to use bitmap transparency in applications without third-party controls

2. Best third party database engine

3. Suggestion for good third party demoing software

4. Good Third Party Add-on VBXs

5. Best Third-Party Products?

6. Need to pass variant of type null to third party tool

7. Need Third-Party Printing OCX

8. Need help finding third party products

9. Need help finding third party products

10. Need help finding third party products

11. Need help finding third party products

12. Need Good Set of 3rd Party Controls for VB Startup

 

 
Powered by phpBB® Forum Software