Hi people. I found this code online in hopes to modifying it for one of my projects. I am using the VB Editor in MS Word 2003 and want to allow the user to drag emails and/or attachments directly into/onto a text box like Outlook has. I included the code below. I was wondering if the Form_DragDrop is a reserved reference or can it be changed to suit the form name you are using. Thank you, DAVE
Option Explicit
Dim rX As Single
Dim rY As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - rX
Source.Top = Y - rY
End Sub
Private Sub List1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Form_DragDrop Source, List1(Index).Left + X, List2(Index).Top + Y
End Sub
Private Sub List1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
rX = X
rY = Y
List1(Index).Drag
End If
End Sub
Private Sub list2_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Form_DragDrop Source, List2(Index).Left + X, List2(Index).Top + Y
End Sub
Private Sub list2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
rX = X
rY = Y
List2(Index).Drag
End If
End Sub
Option Explicit
Dim rX As Single
Dim rY As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - rX
Source.Top = Y - rY
End Sub
Private Sub List1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Form_DragDrop Source, List1(Index).Left + X, List2(Index).Top + Y
End Sub
Private Sub List1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
rX = X
rY = Y
List1(Index).Drag
End If
End Sub
Private Sub list2_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Form_DragDrop Source, List2(Index).Left + X, List2(Index).Top + Y
End Sub
Private Sub list2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
rX = X
rY = Y
List2(Index).Drag
End If
End Sub