copying containers minus their contents

Started by perry59, December 22, 2021, 06:36:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

perry59

another cut/copy/paste kinda thing.
I wish to intercept the copy command and for very specific shapes (containers named "connector") I want to copy the container but NOT it's contents. This will simplify subsequent pasting which I already handle.

In my test code I intercept the copy command via application.IsInScope testing for visCmdUFEditCopy. If it is true I look at the shape that is selected and if it is the specific container shape I'm looking for I can iterate though it and call RemoveFromContainers on each shape it contains. This works but the original shape has it's contents deleted. This is not what I want, I want the original shape left as is and the copy that's in the the clipboard (memory) to be modified.
Can this even be done?
It appears that the container has its members deleted BEFORE the copy, even though I'm in the scope of the copy command.
Any ideas?
Thanks
what, me worry?

wapperdude

#1
Seems like intercepting the command happens after the fact.  So, solution would seem to delete the contents after dropping on page.  Perhaps then re-copy edited shape.

Another possibility might be to just recall and substitute the Master and drop it.
Visio 2019 Pro

perry59

Quote from: wapperdude on December 22, 2021, 08:37:20 PM
Seems like intercepting the command happens after the fact.  So, solution would seem to delete the contents after dropping on page.  Perhaps then re-copy edited shape.

Another possibility might be to just recall and substitute the Master and drop it.

I believe that is correct. I am working on editing the shapes after pasting.
Thanks
what, me worry?