Is it possible to get shape ids after copy command called?

Started by snay, January 18, 2024, 01:47:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

snay

Hello guys!

I'm coding a VSTO addin which provide a special paste feature. That is when user copied a shape and call these special paste command, it will loop through the page's shape to get related shapes to paste together.

To implement it, the first step is to get the id of the shape user copied. I've noticed that after copy, the DataObject in Clipboard many formats. Among them, I think "Visio 15.0 Shapes", "Visio 15.0 Text" might be related. However, without knowing the data structure, I couldn't cast the memorystream back to the origin structure which I thought might contains information about shape id.

I hack way I'm considering is to repurpose the copy command and save the id to the VSTO's runtime memory. But this might lead to unexpected situation when people are copy from other source which should not support this feature.

I've also notices when calling the built in paste special command, the promot window has a source text displayed. So i wonder if there's an apporach to get this source text?



Yacine

Interesting feature indeed.
But wouldn't it be easier to replicate the function by yourself, instead of trying to hack an internally hard wired function?
Yacine