M
miked
I am trying to change Visio shapesheet attributes using VBA. Using
Deletesection deletes the section but when you use addsection to put a new
section of the same type back in the section appears witl ALL previous rows
on the first call to AddRow.
Microsoft documentation clearly states that all rowa are automatically
deleted when you delete the section. (See
http://msdn.microsoft.com/library/d...ssdk11/html/vimthDeleteSection_HV81900482.asp).
Is this working correctly or is there an unknown bug or is the documentation
wrong.
To show you what I mean here is the general code flow with comments:
' Create a shape with 3 rows in section User, Prop, or Action
Set sh = (set the shape)
' Delete the section
sh.DeleteSection VisSectionAction
' Now add a new section
sh.AddSection visSectionAction
' Here is where the wierd bits start
' Show the shapesheet in the visio window and have a look at the section.
The section exists but with no lines. you can programatically confirm this
with the code:
Debug.Print sh.Section(visSectionAction).Count
'The count comes back as 0
' Next add a row
sh.AddRow visSectionAction, VisRowLast, <rowtype>
Debug.Print sh.Section(visSectionAction).Count
' The results return 4 , 3 original rows plus the added row.
' If you now look ad the shapesheet you can see the original 3 rowsplus the
new row.
Deletesection deletes the section but when you use addsection to put a new
section of the same type back in the section appears witl ALL previous rows
on the first call to AddRow.
Microsoft documentation clearly states that all rowa are automatically
deleted when you delete the section. (See
http://msdn.microsoft.com/library/d...ssdk11/html/vimthDeleteSection_HV81900482.asp).
Is this working correctly or is there an unknown bug or is the documentation
wrong.
To show you what I mean here is the general code flow with comments:
' Create a shape with 3 rows in section User, Prop, or Action
Set sh = (set the shape)
' Delete the section
sh.DeleteSection VisSectionAction
' Now add a new section
sh.AddSection visSectionAction
' Here is where the wierd bits start
' Show the shapesheet in the visio window and have a look at the section.
The section exists but with no lines. you can programatically confirm this
with the code:
Debug.Print sh.Section(visSectionAction).Count
'The count comes back as 0
' Next add a row
sh.AddRow visSectionAction, VisRowLast, <rowtype>
Debug.Print sh.Section(visSectionAction).Count
' The results return 4 , 3 original rows plus the added row.
' If you now look ad the shapesheet you can see the original 3 rowsplus the
new row.