无法删除visio中形状的所有连接点

发布于 2024-12-23 05:37:08 字数 315 浏览 0 评论 0原文

我正在尝试使用以下代码删除形状的所有连接点 但仍然有一些连接点没有被删除。 我不明白为什么会发生这种情况

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

煮酒 2024-12-30 05:37:08

第一次循环 currentRow 为 0。因此,您删除了索引为 0 的行。第二行现在成为第一行,其索引从 1 更改为 0。但是,您的循环将 currentRow 增加到 1,因此您跳过新的第一行。每次迭代都会重复此操作,并且您会跳过每隔一行。

您可以简单地删除第一行,直到没有剩余的行。

While Shape.RowExists(Visio.VisSectionIndices.visSectionConnectionPts, visRowFirst, 0)
  Shape.DeleteRow Visio.VisSectionIndices.visSectionConnectionPts, visRowFirst
Wend

根据您的应用程序,最简单的解决方案可能是删除连接点部分:

Shape.DeleteSection Visio.VisSectionIndices.visSectionConnectionPts

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.

While Shape.RowExists(Visio.VisSectionIndices.visSectionConnectionPts, visRowFirst, 0)
  Shape.DeleteRow Visio.VisSectionIndices.visSectionConnectionPts, visRowFirst
Wend

Depending on your application, the simplest solution may be to delete the connection point section:

Shape.DeleteSection Visio.VisSectionIndices.visSectionConnectionPts
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文