无法删除visio中形状的所有连接点
我正在尝试使用以下代码删除形状的所有连接点 但仍然有一些连接点没有被删除。 我不明白为什么会发生这种情况
For currentRow = 0 To shape.Section(Visio.VisSectionIndices.visSectionConnectionPts).Count - 1
shape.DeleteRow Visio.VisSectionIndices.visSectionConnectionPts, visRowFirst + currentRow
Next currentRow
有人能解释一下这部分吗?
I am trying to delete all connection point of shape using following code
but still some connection point does not get deleted.
I don't understand why this happening
For currentRow = 0 To shape.Section(Visio.VisSectionIndices.visSectionConnectionPts).Count - 1
shape.DeleteRow Visio.VisSectionIndices.visSectionConnectionPts, visRowFirst + currentRow
Next currentRow
Can anyone put some light on this part?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一次循环 currentRow 为 0。因此,您删除了索引为 0 的行。第二行现在成为第一行,其索引从 1 更改为 0。但是,您的循环将 currentRow 增加到 1,因此您跳过新的第一行。每次迭代都会重复此操作,并且您会跳过每隔一行。
您可以简单地删除第一行,直到没有剩余的行。
根据您的应用程序,最简单的解决方案可能是删除连接点部分:
The first time through your loop currentRow is 0. You therefore delete the row with index 0. The second row now becomes the first row and its index changes from 1 to 0. Your loop however increments currentRow to 1 so you skip the new first row. This repeats for each iteration and you skip every second row.
You can simply delete the first row until there are no remaining rows.
Depending on your application, the simplest solution may be to delete the connection point section: