J
johnnysocco
Hi there
I am trying to set a shape's custom-properties by code. I can set
numerical fields OK but not text fields - I get a 'type mismatch' when
trying to set a custom-property field which has Type=0 (text) and
format="" (no format).
the following code snippet shows my exact code (which was modified
from tht given in "http://www.design-drawing.com/visio/custprop2.htm"
Dim selObj As Visio.Selection 'Shapes selection collection
Dim shpObj As Visio.Shape 'A shape instance
Set selObj = Visio.ActiveWindow.Selection
For i = 1 To selObj.Count
Set shpObj = selObj(i)
shpObj.Cells("Prop.Width") = 4.5 'works OK
shpObj.Cells("Prop.Height") = 1.5 'works OK
shpObj.Cells("Prop.Text") = "Inserted by Code" 'gives error: Type
Mismatch
next i
What am i doing wrongly? I am putting a string into a string field
but getting a type mismatch.
thanx in advance
Socco
I am trying to set a shape's custom-properties by code. I can set
numerical fields OK but not text fields - I get a 'type mismatch' when
trying to set a custom-property field which has Type=0 (text) and
format="" (no format).
the following code snippet shows my exact code (which was modified
from tht given in "http://www.design-drawing.com/visio/custprop2.htm"
Dim selObj As Visio.Selection 'Shapes selection collection
Dim shpObj As Visio.Shape 'A shape instance
Set selObj = Visio.ActiveWindow.Selection
For i = 1 To selObj.Count
Set shpObj = selObj(i)
shpObj.Cells("Prop.Width") = 4.5 'works OK
shpObj.Cells("Prop.Height") = 1.5 'works OK
shpObj.Cells("Prop.Text") = "Inserted by Code" 'gives error: Type
Mismatch
next i
What am i doing wrongly? I am putting a string into a string field
but getting a type mismatch.
thanx in advance
Socco