Visio add-in getting the font size of shape's text

落花浮王杯 提交于 2019-12-25 03:03:19

问题


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.

Which section, Row and Cell indexes should I use? Or maybe use the Characters object of the shape?


回答1:


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;

Or by:

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;


来源:https://stackoverflow.com/questions/23324917/visio-add-in-getting-the-font-size-of-shapes-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!