News:

Happy New Year!

Main Menu

Make an invisible selection bounding box?

Started by peterennis, June 25, 2010, 02:24:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

peterennis


I can select an object by code, change some property (e.g. color) and
do this with a timer. The result is a background flashing of the selection box
which is undesirable.
If I protect the shape then the code bombs because it is protected!
So I have searched without success to find a way that makes the selection
boundary invisible.
Is there a more sensible way to do this?
In other office apps the object can be selected from code even
if the application is protected. What is the Visio 2010 way?

Thanks,

Peter

Yacine

Hi Peter,
you may want to try to hide the shape handles and the alignement box of your shapes. (RMB Format/Behaviour or in the ShapeSheet "NoObjHandles" and "NoalignBox").
HTH
Yacine
Yacine

Jumpy

When you can select a certain shape by code, you should although be able not to select it and instead assign it to a shape object variable and then change the color:

Dim shp As Visio.Shape
Set shp = ActivePage.Shapes(123) 'for example
shp.Cells("LineColor").Formula = 3

This should work, even if the shape is protected (from being selected).
When the cells you want to change are protected, you could use FormulaForce instead of Formula.

peterennis

Thanks Yacine, that works fine for unprotected shapes.

Thanks Jumpy, that solves protected shapes.

And for anyone else passing this way, here is a small
code snippet using the tip from Jumpy.

20    Dim shp As Visio.Shape
30    Dim MyShape As Visio.Shape
     ' Get the Shape
40    For Each shp In ActivePage.Shapes
50        If shp.Characters.Text Like strName Then
             'ActiveWindow.Select shp, visSelect
60            Debug.Print "shp.ID = " & shp.ID
70            Set MyShape = shp
80            Debug.Print "MyShape.ID = " & MyShape.ID
90            Exit For
100        End If
110    Next


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 194 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1084KB.
Tokens: post-login.
Cache hits: 13: 0.00181s for 26,592 bytes (show)
Cache misses: 3: (show)
Queries used: 17.

[Show Queries]