How to enumerate shapes during a copy operation?

J

James

Basically, I want to know the best approach for enumerating through all the
shapes that have been copied by visio 2003..

I came up with the idea of interrogating the clipboard by

COleDataObject dataObj.AttachClipboard();

using BeginEnumFormats and GetNextFormat, until i can find "Visio 11.0
Shapes" format..

I am able to access the "Visio 11.0 shapes" using the call for GetGlobalData
and GlobalLock to acces the memory.. however I can not find away decoding
the shapes from LPVOID..

I thought of another way by getting getting the current selected shapes, and
enumerating through the shapes.. however this isnt safe, because you can
copy shapes without them being selected.. visio will copy all the shapes on
the page if no selection is made..

so back to the original question, whats the best way of enumerating through
all the shapes during a copy operation?

Regards
James
 
J

JuneTheSecond

How would you like paste method and undo method like
Dim shp As Visio.Shape
ActivePage.Paste
Debug.Print ActiveWindow.Selection.Count
For Each shp In ActiveWindow.Selection
Debug.Print shp.Index, shp.Name
Next
Application.Undo
 

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