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/codes.asp?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 !
Sub sHook(Hwnd As Long, _
strFunction As String)
lpPrevWndProc = apiSetWindowLong(Hwnd, _
GWL_WNDPROC, _
AddressOf strFunction)
End Sub
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"John" <azgtr...@yahoo.com> wrote in message
news:tumh14tu1rs52lqvp...@4ax.com...
AddressOf has been part of Access since Access 2k.
This code has been in production for at least 2 years now with no reports of
problems. It is used to attach external files (pdf's, tiff's, word doc's,
etc.) to various database records. Using this interface for making the
attachments was not my idea, it was a customer request (OK a demand then).
I lost a fair amount of hair, and rebooted my machine many times before I
got it right.
Ron W
"John" <azgtr...@yahoo.com> wrote in message
news:tumh14tu1rs52lqvp...@4ax.com...
Is it also possible to drag a windows filename FROM Access to
Explorer? I haven't been able to locate anything that says it is
possible. Is it as simple as copying the correct (filename)
information to the clipboard -- or much more involved?
Thanks,
I have a database that holds filepath/filename information. I would
like to be able to 'drag' that file information over to another
application that accepts filenames. In this case, it is for something
called "Virtual DJ". When you drop a file (from Explorer) onto
Virtual DJ, the file is processed differently depending on whether you
drop on the left or right side of the program -- so it isn't as simple
as just passing the filename to the program.
From Access Shell out to explorer with the full pathname to the folder that
contains the file(s) you want to drop on Virtual DJ. Then drag em from
explorer on to Virtual DJ directly from explorer. Use Access help to get
additional info on the Shell Command.
From VB. Yup might be time to create a whole new interface to your Access
database that does support Drag Drop.
Sorry :-(
Ron W
<googl...@mp3-boss.com> wrote in message
news:cbdc041d-6805-4441...@59g2000hsb.googlegroups.com...