Catch Copy & Paste events

B

bnk

Is there any way to capture capture copy/paste events?

That is, what we need is not ShapeAdded, but exactly Copy/Paste events.

Also, is there a way to capture Ctrl+Drag?

Our solution needs to process this events to copy some additional data
(extenal data in database) attached shapes, and we need to copy this
data at the moment when the shape is copied, to be able to paste it
later along whith the shape being pasted...

One approach I can see is redirecting standard Copy/Paste commands in
UI to custom ones, that do some activity, and then launch standard
handlers.. (DoCmd)

Another approach seems to be a clipboard monitoring. A hard way to go..
and this way seems to be dangerously close to a hack?

May be there is a simple strightforward way to capture these events?
Thanks.
 
D

David Parker

I think that you need to trap EnterScope and ExitScope events, and check out
the ids of the copy & paste events.

One note of caution :
If you are also trying to trap the events for dragging a shape from one page
to another, then be aware that the Paste event fires on the target page
before the Cut event fires on the source page. This means that the same
shape temporarily exists in two places (and thus both versions have the same
GUID - if you are using these). I think that I solved this by also checking
the containing page of each shape.
 
B

bnk

That's just great! If EnterScope\ExitScope events could be used for
this perpose.. there is no problem at all ;)

Thank you so much for the idea.
 

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