By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

Drag and Drop File Name from Windows Explorer into Access Form Textbox

P: n/a
I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
an Access form's text box. This is a common functionality that most
Windows programs have, so I'm suprised it's not easier to implement in
Access/VBA.

Through Google, I found two VB6 examples and one VBA example on the
Access Web written by Dev Ashish. The VB6 examples used loops to keep
checking for the drag-drop Windows event and prevented my form from
loading. Dev's code looked much better, but it didn't work in Accesss
2003. It looks like it was written prior to Access 2000. The link to
Dev's code is here:
http://www.mvps.org/access/api/api0032.htm
I successfully use many other API calls in my project, but trying to
debug Dev's code is way over my head.

Dev's code refers to a class module named "AddrOf" that is available
here: http://www.trigeminal.com/lang/1033/...p?ItemID=19#19
However, this module has errors under Access 2003 when it runs, one of
which says a DLL file is missing.

VBA under Access 2003 has a built-in function, "AddressOf", that
should accomplish the same thing as the older "AddrOf" class module,
but I can't seem to get it to work. When I try using the "AddressOf"
function in Dev's code, it compiles fine, but when it runs, Access
2003 crashes back to the desktop.

If anyone has VBA code that will allow dragging and dropping
file/folder names from Windows explorer into a form's textbox/listbox,
would you please be kind enough to provide me with the code, or a link
to the code.

Thanks !
Jun 27 '08 #1
Share this Question
Share on Google+
16 Replies


P: n/a
On Wed, 30 Apr 2008 13:10:08 -0700, John <az*********@yahoo.com>
wrote:

A2000 and above have the AddressOf operator.
Follow Dev's example to the letter. Then replace the sHook function
with this code:
Sub sHook(Hwnd As Long, _
strFunction As String)
'lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddrOf(strFunction))
Select Case strFunction
Case "sDragDrop"
lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddressOf sDragDrop)
Case Else
Debug.Assert False 'Need to setup this function as
another Case.
End Select
End Sub

Works for me in A2007.
Happy dropping,

-Tom.
>I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
an Access form's text box. This is a common functionality that most
Windows programs have, so I'm suprised it's not easier to implement in
Access/VBA.

Through Google, I found two VB6 examples and one VBA example on the
Access Web written by Dev Ashish. The VB6 examples used loops to keep
checking for the drag-drop Windows event and prevented my form from
loading. Dev's code looked much better, but it didn't work in Accesss
2003. It looks like it was written prior to Access 2000. The link to
Dev's code is here:
http://www.mvps.org/access/api/api0032.htm
I successfully use many other API calls in my project, but trying to
debug Dev's code is way over my head.

Dev's code refers to a class module named "AddrOf" that is available
here: http://www.trigeminal.com/lang/1033/...p?ItemID=19#19
However, this module has errors under Access 2003 when it runs, one of
which says a DLL file is missing.

VBA under Access 2003 has a built-in function, "AddressOf", that
should accomplish the same thing as the older "AddrOf" class module,
but I can't seem to get it to work. When I try using the "AddressOf"
function in Dev's code, it compiles fine, but when it runs, Access
2003 crashes back to the desktop.

If anyone has VBA code that will allow dragging and dropping
file/folder names from Windows explorer into a form's textbox/listbox,
would you please be kind enough to provide me with the code, or a link
to the code.

Thanks !
Jun 27 '08 #2

P: n/a
On Wed, 30 Apr 2008 21:40:18 -0700, Tom van Stiphout
<no*************@cox.netwrote:

I should have said: Follow Dev's example to the letter, except the
part of getting the AddrOf code from trigeminal.com.

-Tom.
>On Wed, 30 Apr 2008 13:10:08 -0700, John <az*********@yahoo.com>
wrote:

A2000 and above have the AddressOf operator.
Follow Dev's example to the letter. Then replace the sHook function
with this code:
Sub sHook(Hwnd As Long, _
strFunction As String)
'lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddrOf(strFunction))
Select Case strFunction
Case "sDragDrop"
lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddressOf sDragDrop)
Case Else
Debug.Assert False 'Need to setup this function as
another Case.
End Select
End Sub

Works for me in A2007.
Happy dropping,

-Tom.
>>I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
an Access form's text box. This is a common functionality that most
Windows programs have, so I'm suprised it's not easier to implement in
Access/VBA.

Through Google, I found two VB6 examples and one VBA example on the
Access Web written by Dev Ashish. The VB6 examples used loops to keep
checking for the drag-drop Windows event and prevented my form from
loading. Dev's code looked much better, but it didn't work in Accesss
2003. It looks like it was written prior to Access 2000. The link to
Dev's code is here:
http://www.mvps.org/access/api/api0032.htm
I successfully use many other API calls in my project, but trying to
debug Dev's code is way over my head.

Dev's code refers to a class module named "AddrOf" that is available
here: http://www.trigeminal.com/lang/1033/...p?ItemID=19#19
However, this module has errors under Access 2003 when it runs, one of
which says a DLL file is missing.

VBA under Access 2003 has a built-in function, "AddressOf", that
should accomplish the same thing as the older "AddrOf" class module,
but I can't seem to get it to work. When I try using the "AddressOf"
function in Dev's code, it compiles fine, but when it runs, Access
2003 crashes back to the desktop.

If anyone has VBA code that will allow dragging and dropping
file/folder names from Windows explorer into a form's textbox/listbox,
would you please be kind enough to provide me with the code, or a link
to the code.

Thanks !
Jun 27 '08 #3

P: n/a
Hello Tom,

I saw this thread, was interested in it and decided to try it out but I
receive the following error message when I compile the module: "Invalid Use
of AddressOfOperator" on the line below:

lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC, AddressOf sDragDrop)

I have copied the code from the Access Web site, substituted in your module,
created the form and placed the listbox on it.

I am using Access 2003 SP2.

Regards
Anthony

Tom van Stiphout wrote:
>A2000 and above have the AddressOf operator.
Follow Dev's example to the letter. Then replace the sHook function
with this code:
Sub sHook(Hwnd As Long, _
strFunction As String)
'lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddrOf(strFunction))
Select Case strFunction
Case "sDragDrop"
lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddressOf sDragDrop)
Case Else
Debug.Assert False 'Need to setup this function as
another Case.
End Select
End Sub

Works for me in A2007.
Happy dropping,

-Tom.
>>I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
[quoted text clipped - 29 lines]
>>
Thanks !
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #4

P: n/a
On Thu, 01 May 2008 05:32:19 GMT, "biganthony via AccessMonster.com"
<u31673@uwewrote:

I said that my version of Sub sHook should replace the one in Dev's
module. You probably replaced the entire module with my sub. Then the
sDragDrop routine would not exist and you'd get the compile error you
indicated.

-Tom.

>Hello Tom,

I saw this thread, was interested in it and decided to try it out but I
receive the following error message when I compile the module: "Invalid Use
of AddressOfOperator" on the line below:

lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC, AddressOf sDragDrop)

I have copied the code from the Access Web site, substituted in your module,
created the form and placed the listbox on it.

I am using Access 2003 SP2.

Regards
Anthony

Tom van Stiphout wrote:
>>A2000 and above have the AddressOf operator.
Follow Dev's example to the letter. Then replace the sHook function
with this code:
Sub sHook(Hwnd As Long, _
strFunction As String)
'lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddrOf(strFunction))
Select Case strFunction
Case "sDragDrop"
lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddressOf sDragDrop)
Case Else
Debug.Assert False 'Need to setup this function as
another Case.
End Select
End Sub

Works for me in A2007.
Happy dropping,

-Tom.
>>>I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
[quoted text clipped - 29 lines]
>>>
Thanks !
Jun 27 '08 #5

P: n/a
Tom,

Your code was similar to what I tried unsuccessfully already, except
that you added the Debug.Assert part. I copied and pasted your code
for the "sHook" function, and Access 2003 still crashes when I try to
open the form. Everything compiles fine.

I even created a new, blank database (Access 2000 format), with the
only form being "frmDragDrop". The only module in this database is
Dev's module. Access 2003 still crashes to the desktop when I try to
open the form.

I stepped through the code using breakpoints, and all the code
executes without any errors. However, between when the VBA code
completes (after hitting F8 after the final End Sub) and the form is
supposed to open, Access crashes.

Any ideas or help you could provide would be appreciated. I am using
Dev's code, with the exception of substituting your function, and I
have double-checked everything, so I'm at a loss.

Thanks,
John
On Wed, 30 Apr 2008 21:40:18 -0700, Tom van Stiphout
<no*************@cox.netwrote:
>On Wed, 30 Apr 2008 13:10:08 -0700, John <az*********@yahoo.com>
wrote:

A2000 and above have the AddressOf operator.
Follow Dev's example to the letter. Then replace the sHook function
with this code:
Sub sHook(Hwnd As Long, _
strFunction As String)
'lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddrOf(strFunction))
Select Case strFunction
Case "sDragDrop"
lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddressOf sDragDrop)
Case Else
Debug.Assert False 'Need to setup this function as
another Case.
End Select
End Sub

Works for me in A2007.
Happy dropping,

-Tom.
>>I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
an Access form's text box. This is a common functionality that most
Windows programs have, so I'm suprised it's not easier to implement in
Access/VBA.

Through Google, I found two VB6 examples and one VBA example on the
Access Web written by Dev Ashish. The VB6 examples used loops to keep
checking for the drag-drop Windows event and prevented my form from
loading. Dev's code looked much better, but it didn't work in Accesss
2003. It looks like it was written prior to Access 2000. The link to
Dev's code is here:
http://www.mvps.org/access/api/api0032.htm
I successfully use many other API calls in my project, but trying to
debug Dev's code is way over my head.

Dev's code refers to a class module named "AddrOf" that is available
here: http://www.trigeminal.com/lang/1033/...p?ItemID=19#19
However, this module has errors under Access 2003 when it runs, one of
which says a DLL file is missing.

VBA under Access 2003 has a built-in function, "AddressOf", that
should accomplish the same thing as the older "AddrOf" class module,
but I can't seem to get it to work. When I try using the "AddressOf"
function in Dev's code, it compiles fine, but when it runs, Access
2003 crashes back to the desktop.

If anyone has VBA code that will allow dragging and dropping
file/folder names from Windows explorer into a form's textbox/listbox,
would you please be kind enough to provide me with the code, or a link
to the code.

Thanks !
Jun 27 '08 #6

P: n/a
Tom,

I did get it working finally. After starting from scratch again, and
copying and pasting Dev's code, I realized I had changed "sDragDrop"
from a Sub to a Function because I thought "AddressOf" would only work
with a function.

I had also added an "Option Explicit" to the top of Dev's module. The
"Option Explicit" seems to cause problems with the form. I can drag
and drop a file name from Windows Explorer, but if the "Option
Explicit" is present, the form will lock up afterwards. I don't
understand this, but it seems to work now.

I tried testing the "frmDragDrop" many more times to make sure it was
now stable, and occasionally the form seems to lock up, even with the
"Option Explicit" commented out. Maybe this was because I didn't
reboot my machine between my original errors and fixing the problem.
Can you think of any reason why the form would lock up like this, but
only occasionally?

I will probably add this feature to my program, but I will give the
user's the option to disable it (I will probably have it disabled by
default).

Also, I don't fully understand why you have the Debug.Assert also.
Could you explain this. I know the Debug.Assert stops the code from
running at that point, but I have never used it.

Thanks for the help,
John
On Wed, 30 Apr 2008 21:40:18 -0700, Tom van Stiphout
<no*************@cox.netwrote:
>On Wed, 30 Apr 2008 13:10:08 -0700, John <az*********@yahoo.com>
wrote:

A2000 and above have the AddressOf operator.
Follow Dev's example to the letter. Then replace the sHook function
with this code:
Sub sHook(Hwnd As Long, _
strFunction As String)
'lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddrOf(strFunction))
Select Case strFunction
Case "sDragDrop"
lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddressOf sDragDrop)
Case Else
Debug.Assert False 'Need to setup this function as
another Case.
End Select
End Sub

Works for me in A2007.
Happy dropping,

-Tom.
>>I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
an Access form's text box. This is a common functionality that most
Windows programs have, so I'm suprised it's not easier to implement in
Access/VBA.

Through Google, I found two VB6 examples and one VBA example on the
Access Web written by Dev Ashish. The VB6 examples used loops to keep
checking for the drag-drop Windows event and prevented my form from
loading. Dev's code looked much better, but it didn't work in Accesss
2003. It looks like it was written prior to Access 2000. The link to
Dev's code is here:
http://www.mvps.org/access/api/api0032.htm
I successfully use many other API calls in my project, but trying to
debug Dev's code is way over my head.

Dev's code refers to a class module named "AddrOf" that is available
here: http://www.trigeminal.com/lang/1033/...p?ItemID=19#19
However, this module has errors under Access 2003 when it runs, one of
which says a DLL file is missing.

VBA under Access 2003 has a built-in function, "AddressOf", that
should accomplish the same thing as the older "AddrOf" class module,
but I can't seem to get it to work. When I try using the "AddressOf"
function in Dev's code, it compiles fine, but when it runs, Access
2003 crashes back to the desktop.

If anyone has VBA code that will allow dragging and dropping
file/folder names from Windows explorer into a form's textbox/listbox,
would you please be kind enough to provide me with the code, or a link
to the code.

Thanks !
Jun 27 '08 #7

P: n/a
Tom,

I followed your instaructions - I am using Dev''s code with the exception of
the sHook sub. I copied and pasted your sHook sub into the code, replacing
Dev's.

The sDragDrop does exit in my module.

Anthony
Tom van Stiphout wrote:
>I said that my version of Sub sHook should replace the one in Dev's
module. You probably replaced the entire module with my sub. Then the
sDragDrop routine would not exist and you'd get the compile error you
indicated.

-Tom.
>>Hello Tom,
[quoted text clipped - 39 lines]
>>>>
Thanks !
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #8

P: n/a
I should have said, "The sDragDrop does exist in my module."
biganthony wrote:
>Tom,

I followed your instaructions - I am using Dev''s code with the exception of
the sHook sub. I copied and pasted your sHook sub into the code, replacing
Dev's.

The sDragDrop does exit in my module.

Anthony
>>I said that my version of Sub sHook should replace the one in Dev's
module. You probably replaced the entire module with my sub. Then the
[quoted text clipped - 8 lines]
>>>>>
>Thanks !
--
Message posted via http://www.accessmonster.com

Jun 27 '08 #9

P: n/a
On Thu, 01 May 2008 21:54:01 GMT, "biganthony via AccessMonster.com"
<u31673@uwewrote:

Send me an email (my spam trap should be easy to figure out) and I
will send you my version. Perhaps there is something else I
overlooked.

-Tom.
>I should have said, "The sDragDrop does exist in my module."
biganthony wrote:
>>Tom,

I followed your instaructions - I am using Dev''s code with the exception of
the sHook sub. I copied and pasted your sHook sub into the code, replacing
Dev's.

The sDragDrop does exit in my module.

Anthony
>>>I said that my version of Sub sHook should replace the one in Dev's
module. You probably replaced the entire module with my sub. Then the
[quoted text clipped - 8 lines]
>>>>>>
>>Thanks !
Jun 27 '08 #10

P: n/a
On Thu, 01 May 2008 14:28:44 -0700, John <az*********@yahoo.com>
wrote:

Good work.
I would be REALLY surprised if Option Explicit causes the problems you
describe. It is essentially no more than a flag to the compiler to say
"don't accept undeclared variables".

Does your code compile? (debug compile)

On the topic of Debug.Assert: that's a habit of mine which I call
Defensive Programming.
Note that the sHook procedure is designed to only work when we pass in
"sDragDrop". So what if an innocent maintenance programmer, or even
myself a year later when I have forgotten all about this function,
would call it with a different strFunction argument. It could even be
a typo. Wouldn't it be nice if the first time the developer unit tests
the new code it would stop and tell him/her that an unexpected value
was passed in? I think a MsgBox is not as appropriate because this
kind of error should really not happen in Production, only during
development.
So any time I write a Select Case statement with an enumerated list of
options I am planning on handling, I write the Case Else to say "Yo!
You didn't implement this option". That's what Debug.Assert does for
me. In Production, it compiles to nothing and thus does not slow down
the program.
It would have been better if I had written:
Debug.Assert False 'Option not implemented.

-Tom.

>Tom,

I did get it working finally. After starting from scratch again, and
copying and pasting Dev's code, I realized I had changed "sDragDrop"
from a Sub to a Function because I thought "AddressOf" would only work
with a function.

I had also added an "Option Explicit" to the top of Dev's module. The
"Option Explicit" seems to cause problems with the form. I can drag
and drop a file name from Windows Explorer, but if the "Option
Explicit" is present, the form will lock up afterwards. I don't
understand this, but it seems to work now.

I tried testing the "frmDragDrop" many more times to make sure it was
now stable, and occasionally the form seems to lock up, even with the
"Option Explicit" commented out. Maybe this was because I didn't
reboot my machine between my original errors and fixing the problem.
Can you think of any reason why the form would lock up like this, but
only occasionally?

I will probably add this feature to my program, but I will give the
user's the option to disable it (I will probably have it disabled by
default).

Also, I don't fully understand why you have the Debug.Assert also.
Could you explain this. I know the Debug.Assert stops the code from
running at that point, but I have never used it.

Thanks for the help,
John
On Wed, 30 Apr 2008 21:40:18 -0700, Tom van Stiphout
<no*************@cox.netwrote:
>>On Wed, 30 Apr 2008 13:10:08 -0700, John <az*********@yahoo.com>
wrote:

A2000 and above have the AddressOf operator.
Follow Dev's example to the letter. Then replace the sHook function
with this code:
Sub sHook(Hwnd As Long, _
strFunction As String)
'lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddrOf(strFunction))
Select Case strFunction
Case "sDragDrop"
lpPrevWndProc = apiSetWindowLong(Hwnd, GWL_WNDPROC,
AddressOf sDragDrop)
Case Else
Debug.Assert False 'Need to setup this function as
another Case.
End Select
End Sub

Works for me in A2007.
Happy dropping,

-Tom.
>>>I am looking for VBA code that will work with Access 2003 to enable
dragging and dropping a file/folder name from Windows XP Explorer into
an Access form's text box. This is a common functionality that most
Windows programs have, so I'm suprised it's not easier to implement in
Access/VBA.

Through Google, I found two VB6 examples and one VBA example on the
Access Web written by Dev Ashish. The VB6 examples used loops to keep
checking for the drag-drop Windows event and prevented my form from
loading. Dev's code looked much better, but it didn't work in Accesss
2003. It looks like it was written prior to Access 2000. The link to
Dev's code is here:
http://www.mvps.org/access/api/api0032.htm
I successfully use many other API calls in my project, but trying to
debug Dev's code is way over my head.

Dev's code refers to a class module named "AddrOf" that is available
here: http://www.trigeminal.com/lang/1033/...p?ItemID=19#19
However, this module has errors under Access 2003 when it runs, one of
which says a DLL file is missing.

VBA under Access 2003 has a built-in function, "AddressOf", that
should accomplish the same thing as the older "AddrOf" class module,
but I can't seem to get it to work. When I try using the "AddressOf"
function in Dev's code, it compiles fine, but when it runs, Access
2003 crashes back to the desktop.

If anyone has VBA code that will allow dragging and dropping
file/folder names from Windows explorer into a form's textbox/listbox,
would you please be kind enough to provide me with the code, or a link
to the code.

Thanks !
Jun 27 '08 #11

P: n/a
Thanks for the code Tom. It works.

Anthony

Tom van Stiphout wrote:
>Send me an email (my spam trap should be easy to figure out) and I
will send you my version. Perhaps there is something else I
overlooked.

-Tom.
>>I should have said, "The sDragDrop does exist in my module."
[quoted text clipped - 13 lines]
>>>>>>>
>>>Thanks !
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #12

P: n/a
On Sun, 04 May 2008 21:50:21 GMT, "biganthony via AccessMonster.com"
<u31673@uwewrote:

Super. What was different between yours and mine?
-Tom.
>Thanks for the code Tom. It works.

Anthony

Tom van Stiphout wrote:
>>Send me an email (my spam trap should be easy to figure out) and I
will send you my version. Perhaps there is something else I
overlooked.

-Tom.
>>>I should have said, "The sDragDrop does exist in my module."
[quoted text clipped - 13 lines]
>>>>>>>>
>>>>Thanks !
Jun 27 '08 #13

P: n/a
Tom,
The code was exactly the same, which I don't understand why the error
occurred. I deleted my attempt when I received yours but I have the feeling
that I foolishly copied the code to the module behind the form, instead of a
new module. I can't believe I let that happen. I totally missed the line on
the Dev''s site where he says: "Paste this code in a new module." !!

Thanks for your help - without having your code to look at I doubt if I had
picked up my own mistake.
Anthony

Tom van Stiphout wrote:
>Super. What was different between yours and mine?
-Tom.
>>Thanks for the code Tom. It works.
[quoted text clipped - 11 lines]
>>>>>>>>>
>>>>>Thanks !
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #14

P: n/a
If I'm reading the code correctly for 'Sub sDragDrop' it is limited to
a path length of 50 characters for each file. This seems to be
confirmed by testing, where if I drag and drop the files

C:\Documents and Settings\gdt\My Documents\a.txt
C:\Documents and Settings\gdt\My Documents\b.txt

the form says "2 files dropped" and lists them correctly, but if I
rename the files to

C:\Documents and Settings\gdt\My Documents\foobar.txt
C:\Documents and Settings\gdt\My Documents\bazbin.txt

and try again the form says "1 files dropped", the listbox displays

C:\Documents and Settings\gdt\My Documents\foobar

(truncated after 49 characters) and A2007 gets somewhat grumpy after
that.
Jun 27 '08 #15

P: n/a
Gord/Tom,

Mine truncates to 49 characters as well. Do you guys have a fix for
this? 49 characters is too short, especially for files on a desktop
folder.

Thanks,
John

On Tue, 6 May 2008 07:47:13 -0700 (PDT), Gord <gd*@kingston.net>
wrote:
>If I'm reading the code correctly for 'Sub sDragDrop' it is limited to
a path length of 50 characters for each file. This seems to be
confirmed by testing, where if I drag and drop the files

C:\Documents and Settings\gdt\My Documents\a.txt
C:\Documents and Settings\gdt\My Documents\b.txt

the form says "2 files dropped" and lists them correctly, but if I
rename the files to

C:\Documents and Settings\gdt\My Documents\foobar.txt
C:\Documents and Settings\gdt\My Documents\bazbin.txt

and try again the form says "1 files dropped", the listbox displays

C:\Documents and Settings\gdt\My Documents\foobar

(truncated after 49 characters) and A2007 gets somewhat grumpy after
that.
Jun 27 '08 #16

P: n/a
Hi everyone.

I have a problem with this Drag and Drop code. I've followed all the
instructions and it works fine but the for window freezes sometimes.
Also, if I add any buttons on the form I cant press them. (freezed).
Anyone has encountered this kinf of error?

Tom, can you please e-mail me a copy of file which works ok ?

Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Aug 22 '08 #17

This discussion thread is closed

Replies have been disabled for this discussion.