Change shape / geometry

Started by jimmyhopps, August 07, 2012, 03:01:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jimmyhopps

Hi all.  wondering if anyone can help me with this basic question.

I am trying to change the outline of a basic shape in an org chart, by modifying its lines via the geometry section of the shape sheet.  I need to do this in code.  in the sample below, i'm trying to turn a box/rectangle into a triangle

using the macro recorder (ya i'm that basic), and some tweeks, i came up with the following: 


Sub ToTriangle()
    Dim ThisShape As Visio.Shape

       For Each ThisShape In Application.ActiveWindow.Selection
 
          If (ThisShape.Style <> "Connector") Then
            Application.ActiveWindow.Shape.CellsSRC(visSectionFirstComponent, 2, 0).FormulaU = "Width * 0.5"
            Application.ActiveWindow.Shape.CellsSRC(visSectionFirstComponent, 3, 1).FormulaU = "Height * 0"
            Application.ActiveWindow.Shape.DeleteRow visSectionFirstComponent, 4
        End If
       
    Next

End Sub



Jumpy

First you should replace

Application.ActiveWindow.Shape.CellsSRC.....

with

ThisShape.CellsSRC...

as that is the shape you want to change.

Browser ID: smf (is_webkit)
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: 144 (show)
Files included: 34 - 1321KB. (show)
Memory used: 1096KB.
Tokens: post-login.
Cache hits: 12: 0.00275s for 26,582 bytes (show)
Cache misses: 1: (show)
Queries used: 18.

[Show Queries]