Visio加载项获取形状文本的字体大小
问题描述:
我正在尝试确定形状文本的字体大小.
当我使用Visio作为用户时,我可以在Shape sheet
(在Character->size
下)看到此值
但是,我无法理解如何以编程方式访问它以进行阅读.
I'm trying to determine the size of the font of a shape's text.
When I use Visio as a user, I can see this value in the Shape sheet
(under Character->size
)
However I'm not able to understand how to access it programatically, for reading.
我应该使用哪个section, Row and Cell
索引?还是可以使用形状的Characters对象?
Which section, Row and Cell
indexes should I use? Or maybe use the Characters object of the shape?
答
我通过以下方式成功获得了公式:
I was successful in obtaining the formula by:
string fontSize = shape.CellsSRC[(short) Visio.VisSectionIndices.visSectionCharacter,
(short) Visio.VisRowIndices.visRowCharacter,
(short) Visio.VisCellIndices.visCharacterSize].Formula;
或通过:
string fontSize = shape.CellsSRC[3,0,7].Formula;
实际上是一样的,只是可读性不高,或者是:
Which is practically the same, only not very readable, Or by:
string fontSize = shape.get_Cells("Char.Size").Formula;