Re: How to preserve the user's clipboard contents?
- From: Benjamino5 <Benjamino5@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 Sep 2006 13:56:02 -0700
Karl,
Thanks for the detailed answer and the links. I've never used VB (though I'd
like to learn), and I now understand the magnitude of this task.
I will follow your original advice--apologize to the users. ;)
Ben
"Karl E. Peterson" wrote:
Hi Ben --.
Windows offers an API called RegisterClipboardFormat, which effectively
allows anyone to define any random binary structure as a custom format. In
theory, you could just store these as binary blobs, then put them back on
just as they were. But you're further complicated by CF_OWNERDISPLAY items,
in which the original application is called upon to draw on demand.
Do you do any plain-vanilla VB? If so, you might find
http://vb.mvps.org/samples/ClipView to be of interest. It enumerates the
formats available, and displays those it understands. You could diddle with
extending it to other formats, to get an idea of how that might be
approached by VB(A). Another demo, http://vb.mvps.org/samples/ClipEx, may
show you how to approach multiple formats through VBA.
But in the end, saving and restoring the clipboard will be a gargantuan task
that will probably never be 100%.
Sorry... Karl
Benjamino5 wrote:
Karl,
Thanks for the response, though it's disheartening. By "custom"
formats, do you mean that there are so many different data types it's
not possible to make a DataObject that could contain them?? Or...?
Here's another tack: can I access the multiple-item functionality of
the clipboard in VBA? I haven't found a way to do it yet, so perhaps
there isn't a way.
Ben
"Karl E. Peterson" wrote:
Benjamino5 wrote:
My template needs to use Selection.Range.Copy and other clipboard
operations.
However, any time I call a method that uses the clipboard, I will be
wiping out the *user's* own clipboard contents!
I'd like to write a sub that will take whatever's in the
clipboard--text AND pictures AND MathType objects, etc.--and store
it somewhere. Then, after my template uses the clipboard for its own
operations, it should restore the original contents of the
clipboard.
I imagine this is a common enough problem that many people here have
dealt with it. What do you do? Do you have any code samples I could
use?
Apologize. With humility and deep respect for your user. Or find
another way.
It's an impossible task, given Windows support of "custom" formats.
--
Working without a .NET?
http://classicvb.org/
--
Working without a .NET?
http://classicvb.org/
- Follow-Ups:
- Re: How to preserve the user's clipboard contents?
- From: Karl E. Peterson
- Re: How to preserve the user's clipboard contents?
- References:
- Re: How to preserve the user's clipboard contents?
- From: Karl E. Peterson
- Re: How to preserve the user's clipboard contents?
- From: Karl E. Peterson
- Re: How to preserve the user's clipboard contents?
- Prev by Date: Re: Checking custom properties between template and document??
- Next by Date: Re: How to preserve the user's clipboard contents?
- Previous by thread: Re: How to preserve the user's clipboard contents?
- Next by thread: Re: How to preserve the user's clipboard contents?
- Index(es):
Relevant Pages
|