Visio RowType?

I love spelunking through the Visio shapesheet and creating Visio shapes that are more than just plain clipArt. I use CellsSRC() to explore because I can iterate through an entire shapesheet and learn. Though CellsSRC sounds like Cells Source, it actually stands for Section, Row and Cell. Section is misleading. If you look at the shapesheet, several sections that appear are actually all part of Section 1. Graham Wideman, one of the first Visio MVPs, did a great series of books explaining the intricacies of the shapesheet. Though it was a while ago, most of the information is still quite relevant. Any good Visio developer should have one on hand. I have them all and the are well used.

One thing I noticed was an object called RowType that does not have an explanation for the enumerations. There is a document on Geometry rows (it is under Geometry Section) but the other shapesheet sections are little more than a placeholder with a bried description and no links to further information, For example, Group Properties Section just says
“Contains cells for a group that control how you add shapes to a group, move members of a group, and select groups.”
Actually, Visio alumni David Cole pointed out that the page I mentioned, just has names, but no values. The VisioTag enumeration page has the names/values.

Here is some VBA code I used to find the RowTypes of the shapes on the current page.

Sub RTTest()
Dim curRow As Integer, nrows As Integer, RowCnt As Integer, SectNo As Integer, VsoShp As Visio.Shape
For Each VsoShp In ActivePage.Shapes
    For SectNo = 1 To 255
        nrows = VsoShp.RowCount(SectNo)
        If VsoShp.SectionExists(SectNo, visExistsAnywhere) Then
            Select Case SectNo
            Case visSectionObject
                For curRow = 1 To 512
                    If VsoShp.RowExists(SectNo, curRow, 1) Then
               Debug.Print SectNo, curRow, VsoShp.RowType(SectNo, curRow)
                    End If
                Next curRow
             Case Else
                For curRow = 0 To (nrows - 1)
                Debug.Print SectNo, curRow, VsoShp.RowType(SectNo, curRow)
                Next curRow
            End Select
        End If
    Next SectNo
Next VsoShp
End Sub

and these are the results from my test shapes.

Section 1 sub 1155
Section 1 sub 4157
Section 1 sub 6167
Section 1 sub 11135
Section 1 sub 12156
Section 1 sub 17164
Section 1 sub 27243
Section 1 sub 29245
Section 2131
Section 3148
Section 4149
Section 5136
Section 7153
Section 8161
Section 9170
Geometry Sections137, 138, 139, 140, 141, 143, 144, 165, 166, 193, 195, 236, 237, 238, 239, 239, 240
Section 240169
Section 244196
Section 247199
Section 248247
Section 249248

It appears that the RowTypes are unique. Section 1 is a collection of rows. The Geometry Section ones do match the documentaion.

So, why the interest? A while back I created a set of Visio shapesheet section shapes. I was dissapointed that images of the shapesheet in documentation did not POP!. They were a joy for those who appreciated the shapesheet, but seemed to contain a lot of noise for someone struggling to understand. For example, the columns on LangId and Calendar were distracting. A Visio shape can be enhanced to make the text or background colour of a shapesheet cell standout. Distracting cells can be deleted, but would remain to give the cells of interest relativity to other cells and presence. Something a simple screenshot can not do without a lot of post production work. (If you wanted to update the shapesheet, then it is back to square one)
The next step was to be able to drop shapes on a Visio page and have Visio create a stencil of shapesheet section shapes that reflected those shapes.

I can go through a shapesheet using CellsSRC(), but it would be useful if Visio would tell me what I am looking at as I wander the shapesheet so I can place itappropriately in a new shapesheet section shape. I think RowType is the answer, but I can not find the appropriate documention.

For now I will use the Pokemon method and build my own table.
Pokemon Method – find them in the wild and use the environment I find them in to build a more descrpitive name. … and yes, I want to catch them all.

I hope you find this useful.

John… Visio MVP in x-aisle

Published by johnvisiomvp

The original Visio MVP. I have worked with the Visio team since 1993