英文:
Set Container font size using Visio VBA
问题
I have code that is generating containers for a VBA diagram. I need to specify the font size for each container from VBA. For container shape con, I'm trying:
con.Cells("Char.Size").FormulaForceU = "8 pt"
This will cause the font size drop-down in the Visio UI to update to 8pt as well as the cell value in the shape sheet, but it does not actually change the font size for the container. I can change the size manually without issue.
Is there a step I am missing here?
英文:
I have code that is generating containers for a VBA diagram. I need to specify the font size for each container from VBA. For container shape con, I'm trying:
con.Cells("Char.Size").FormulaForceU = "8 pt"
This will cause the font size drop-down in the Visio UI to update to 8pt as well as the cell value in the shape sheet. but it does not actually change the font size for the container. I can change the size manually without issue.
Is there a step I am missing here?
答案1
得分: 1
容器形状
包含一些子形状!
在这个例子中,您可以看到一对子形状。它们每个都有自己的单个子形状...
通常,容器中有4-5个子形状的摘要。
您必须定义容器的结构,并找到 'Header' 形状的索引
con.Shapes(2).Cells("Char.Size").FormulaForceU = "8 pt"
这是针对索引为2的子形状的示例。
这将导致 Visio UI 中的字体大小下拉框更新为8pt,以及形状表中的单元格值。
当您使用 UI 进行更改时,将应用于容器和所有子形状。但通过 ShapeSheet,您只能更改单个(活动)形状!
英文:
Container shape
consist of some sub-shapes!
In this example you can see into pair of sub-shapes. Each of them have own single sub-shape…
Usually container have into 4-5 sub-shapes summary.
You must define structure of your container, and find index of 'Header' shape
con.Shapes(2).Cells("Char.Size").FormulaForceU = "8 pt"
This example for sub-shape with index = 2.
> This will cause the font size drop-down in the Visio UI to update to 8pt as well as the cell value in the shape sheet.
When you use UI changes apply for container and all sub-shapes. But via ShapeSheet you can change only single (active) shape!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论