PDA

View Full Version : Drag & drop a file to automatically copy it to a destination folder



ecalid
04-05-2023, 06:56 AM
Hello again!

I just wanted to thank you again for your help previously with regards to the filepath and destination issue I had before.

It still works well and it has been well received by the staff.

Their only gripe appears to be that they have to open up a browse dialogue in order to select a file and it then generates the filepath from it's existing location.

What they would like to do, is to be able to drag and drop a file from anywhere, such as an attachment from an outlook email, onto the folder icon, which will then automatically copy to a destination folder, a "temporary holding area" lets say, which will then be copied again into the specified folder using the existing script which you helped with.

Is this something you guys could, once again, help me with?

Thank you in advance.

I've attached my workbook so you can see what I mean.
https://file.io/fUgkFPqAowHp

June7
04-05-2023, 12:38 PM
This has been asked and discussed numerous times in multiple forums. Have you searched?

ecalid
04-06-2023, 01:50 AM
Thank you for your reply June7.

I have had a good look around, I'm afraid I am just not that advanced when it comes to coding to be able to put together various modules etc.

Also I'm not sure they do exactly what I need them to do.

For example,

Once the file has been dropped onto a userform, I need it to copy it to a destination folder, and then provide me with a filepath to it.

But I'm struggling to find any like this?

georgiboy
04-11-2023, 07:37 AM
Perhaps you could use a little workaround using TreeView?

It will will help getting the path of a dropped file, in the attached it changes the caption of Label1 when i file is dropped on the TreeView.

ecalid
04-11-2023, 07:49 AM
Perhaps you could use a little workaround using TreeView?

It will will help getting the path of a dropped file, in the attached it changes the caption of Label1 when i file is dropped on the TreeView.

Thanks Georgiboy, this is great however it doesn't accept attachments which are dragged from outlook emails, which is the primary function I need.

Could this be adapted to incorporate such a function?

June7
04-11-2023, 11:16 AM
Also review https://stackoverflow.com/questions/66246329/drag-and-drop-outlook-attachment-into-access-form