Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Data.GetFormat(vbCFFiles) Then
sFile = Data.Files(1)
richtextbox1.loadfile sFile, rtfText
End If

解决方案 »

  1.   

    Private Sub Form_Load()    
        Me.OLEDropMode = 1
    End SubPrivate Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
        Dim nIndex As Integer
        Dim nCounter As Integer
        With Data
            If .GetFormat(15) = True Then
                nCounter = .Files.Count
                For nIndex = 1 To nCounter
                    MsgBox Data.Files(nIndex)
                Next
            End If
        End With
    End Sub