检查 Visio Shape.Cell 集合
我需要一些关于如何在 vb 或 vba 中查询 VISIO Shape.cells 集合的建议。
我编写了一个应用程序来将形状拖放到页面上,并且可以在将其拖放到页面上后更改其名称。现在我想检查形状细胞集合。
谢谢
I need some suggestion on how to query a VISIO Shape.cells collection in vb or vba.
I have written an application to drop a shape on a page and I can change its name after dropping it on the page. Now I want to examine the shape cells collection.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Visio 形状单元被分成不同的部分。此类部分可能包括用户单元格、操作或角色设置。还有一系列命名单元格,您只能(我认为)通过名称(即 PinX 或 PinY)访问。
因此,要查询形状的单元格,您首先必须弄清楚您正在谈论的单元格的哪个部分。要循环遍历单元格部分,首先获取该部分中的行数,然后使用形状对象上的 CellsSRC 方法循环遍历该部分。
如果存在多种形状的大量单元格,则以这种方式循环可能会很慢。如果您需要访问大量单元格的公式或结果,Page 对象上有 GetFormulas 和 GetResults 方法,它们采用 SRC 值和形状 ID 数组,从而同时提取所有这些公式/结果。
Visio shape cells are broken up into different sections. Such sections might include User Cells, Actions, or Character settings. There are also a series of named cells that you can only (I think) access through the name (i.e. PinX or PinY).
So to query a shape's cells, you first have to figure out what section of cells you're talking about. To loop through a cell section, you first get the number of rows in the section, then loop through that section using the CellsSRC method on the shape object.
Looping in this way can be slow if there are a lot of cells in a lot of shapes. If you need to access the formulas or results of a large number of cells, there are GetFormulas and GetResults methods on the Page object that take arrays of SRC values and shape ID's that will pull all those Formulas/Results at the same time.