要从Visio形状获取自定义形状信息:
Function GetCustomPropertyValue(TheShape As Visio.Shape, ThePropertyName As String) As String
On Error Resume Next
GetCustomPropertyValue = TheShape.CellsU("Prop." & ThePropertyName).ResultStr(visNone)
End Function
Run Code Online (Sandbox Code Playgroud)
所有这个函数都使用形状上的cellsu属性来按名称获取自定义属性ShapeSheet单元格...
如果你是关于使用接下来的错误恢复的坚持者,你可以通过首先检查单元是否存在来检查单元是否存在:
if TheShape.CellExistsU( "Prop." & ThePropertyName , 0 ) then
GetCustomPropertyValue = TheShape.CellsU("Prop." & THePropertyName).ResultStr(VisNone)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23061 次 |
| 最近记录: |