Shape.RowType is always -1

Started by marko999, August 09, 2012, 06:50:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

marko999

Hi all,

I'm trying to get Geometry data, and I need RowType property for each of rows in Geometry sections.
But, for some reason, RowType function always returns -1, I don't get it why...
Can somebody help?


'Get the shape from the active page.
Set vsoShape = ActivePage.Shapes(1)

'Get the count of Geometry sections in the shape.
'(If the shape is a group, this will be 0.)
intSections = vsoShape.GeometryCount

'Iterate through all Geometry sections for the shape.
'Because we are adding the current Geometry section index to
'the constant visSectionFirstComponent, we must start with 0.
For intCurrentGeometrySectionIndex = 0 To intSections - 1

    'Set a variable to use when accessing the current
    'Geometry section.
    intCurrentGeometrySection = visSectionFirstComponent + intCurrentGeometrySectionIndex
   
    'Get the count of rows in the current Geometry section.
    intRows = vsoShape.RowCount(intCurrentGeometrySection)
   
    'Loop through the rows. The count is zero-based.
    For intCurrentRow = 0 To (intRows - 1)
   
        Debug.Print vsoShape.RowType(intCurrentGeometrySection, intRows) 'always -1
       
       'Get the count of cells in the current row.
       intCells = vsoShape.RowsCellCount(intCurrentGeometrySection, intCurrentRow)
       
       'Loop through the cells. Again, this is zero-based.
       For intCurrentCell = 0 To (intCells - 1)
          Debug.Print vsoShape.CellsSRC(intCurrentGeometrySection, intCurrentRow, intCurrentCell).LocalName & ": " & vsoShape.CellsSRC(intCurrentGeometrySection, intCurrentRow, intCurrentCell).Result("mm")
       Next intCurrentCell
       
    Next intCurrentRow
Next intCurrentGeometrySectionIndex

aledlund

"Debug.Print vsoShape.RowType(intCurrentGeometrySection, intRows) 'always -1"

possibly because intRows as an index will point past the last row (index is 0 based)?

may be rather than intRows you might want to use intCurrentRow?

al

marko999

Quote from: aledlund on August 09, 2012, 10:15:58 PM
"Debug.Print vsoShape.RowType(intCurrentGeometrySection, intRows) 'always -1"

possibly because intRows as an index will point past the last row (index is 0 based)?

may be rather than intRows you might want to use intCurrentRow?

al

Ooooh man, I can't get use to this VBA thing :D (blush)
Thank you very much and I apologize for this stupid question, moderators you can delete it! :)

Marko

aledlund

My wife knows how things are going when I come up and say "I learned a lot today"
da nada,
al

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: 176 (show)
Files included: 34 - 1321KB. (show)
Memory used: 1095KB.
Tokens: post-login.
Cache hits: 12: 0.00207s for 26,583 bytes (show)
Cache misses: 1: (show)
Queries used: 18.

[Show Queries]