Saving the contents of the clipboard

J

Josh Sale

I have and Excel 97 - 2003 add-in that under certain circumstances uses the
clipboard. Before using the clipboard I try to save its contents using code
like the following:

Dim MyDataObj As New DataObject
Dim SaveOfClipboard As Variant

MyDataObj.GetFromClipboard
SaveOfClipboard = MyDataObj.GetText()

so that I can restore it when I'm done in case the user has something of
interest to them on the clipboard.

This mostly works OK unless the user has a bunch of data on the clipboard in
which case only the first bit is saved using the above code.

Is there a better/more complete way of quickly saving and restoring the
contents of the clipboard? I think doing a File | Save of the clipboard
will be too slow so I need something that performs better.

TIA,

josh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top