Selection in a group

L

Lisa Wenzel

Hello everybody,

I have a group with lots of shapes and want to change the PInX and PinY of every one.

My code is: =

Public Sub changePIN()
Dim shp As Shape
If Application.ActiveWindow.Selection.Count =3D 1 Then
Set shp =3D Application.ActiveWindow.Selection.Item(1)
shp.CellsSRC(visSectionObject, visRowXFormOut, visXFormLocPinX).FormulaU =3D=
"Width*1"
shp.CellsSRC(visSectionObject, visRowXFormOut, visXFormLocPinY).FormulaU =3D=
"Height*1" =

Else
MsgBox "Bitte w=C3=A4hlen Sie etwas aus"
End If
End Sub

The macor works, but I=C2=B4ve a problem using it for grouped shapes: When I select a s=
hape in a group, the macro says, that no shape is selected.
What do I have to do to fix that???

Thank you for your help,
regards
eLiz

url:http://www.ureader.com/gp/1133-1.aspx
 
J

JuneTheSecond

HHi, eLiz.

Please, check IterationMode.

Visio SDK has examole codes in code librarian.
Keywords may be IteretionMode.
 
L

Lisa Wenzel

Hey JuneTheSecond,

thank you for your advice. I foun dthe example in the SDK - but my
VB-Knowledge is to bad to tranfer this into my macro.

Can you please specify how to write the macro for this usecase?

Thank you much for your help,
eLiz

url:http://www.ureader.com/msg/1133604.aspx
 
C

Chris Roth [Visio MVP]

Hi Lisa,

This question comes up a lot, so I wrote an article for the Visio Guy
web-site, complete with code samples.

You can find it here:

Detect Sub-selected Shapes Programmatically
http://www.visguy.com/2008/05/17/detect-sub-selected-shapes-programmatically/

--
Hope this helps,

Chris Roth
Visio MVP


Visio Guy: Smart Graphics for Visual People

Articles: http://www.visguy.com
Shapes: http://www.visguy.com/shapes
Dev: http://www.visguy.com/category/development/
Forum: http://www.viguy.com/vgforum
 

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

Similar Threads


Top