Drag and Drop (or cut and paste) records from Access and Excel to my app

Posted on 2004-11-18
Last Modified: 2010-04-05
Hi everybody

I would like to be able to fill the contents of  a Delphi form from an Acess or Excel "record" preferably via drag and drop.

1. In Access I can do a selection of some rows and then copy it to clipboard and thence to wherever.. the clipboard contents MAY be in some special format, because when I  paste to a text editor the contents include a row with the field names.
How can I find out if this is some special format on the clipboard?

2. I would prefer to drag those rows from Access and drop them on my Delphi app. Is there any way of doing this?

3. Excel is not as nice as Access in that it does not give me the field (column) names in a simple copy and paste to text editor (and omits empty fields) , but because there is a "paste special" entry in the context menu, it makes me think that the copy on the clipboard should  contain significantly more info.

If so, how can I find out about this? Where is it likely to be documented .. I guess the more general question is how can I find what any app pastes to the clipboard, and in what format .. some sort of clipboard monitor?  I had a quick look at Tclipboard, butI am not sure if it detects all clipboard formats

4. Again, I would like to drag the selected rows from Excel to my app .. is there a way?

Question by:Mutley2003
    LVL 14

    Assisted Solution

    You would need to find out more about OLE Drag and Drop then... Here are some links that might be useful to kickstart:
    LVL 12

    Accepted Solution

    don't know the format of excell OLE Data (probably has severa different formats, the first being the richest)
    but you can use this as a start for handling OLE drag&drop .. clipboard handling can be implemented in the same way

    Author Comment


    thanks for the feedback and the code (Lee).  DragonSlayer, fwiw, unitoops is now DropMaster at selling at $99

    from experimentation, it appears that neither Excel or Access initiate a drag for a selected row. So I cannot drop what has never been dragged.

    This seems very peculiar behaviour on the part of Office.

    There is a somewhat useful article on the preferences of various Office applications for different clipboard formats at

    LVL 12

    Expert Comment

    useful stuff there .. tnx :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
    This video discusses moving either the default database or any database to a new volume.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now