ResultStr property

Microsoft Visio Developer Reference

ResultStr property

       

Gets the value of a cell expressed as a string.

Version added

4.0

Syntax

stringRet = object.ResultStr(unitsNameOrCode)

stringRet

String. The cell's value returned as a string.

object

Required. An expression that returns a Cell object.

unitsNameOrCode

Required Variant. The units to use when retrieving the value.

Remarks

Setting the ResultStr property is similar to setting a cell's Result property. The difference is that ResultStr property returns a string for the value of the cell, whereas the Result property returns a floating point number.

You can specify unitsNameOrCode as an integer or a string value. If the string is invalid, an error is generated. For example, the following statements all set unitsNameOrCode to inches.

stringRet = Cell.ResultStr(visInches)

stringRet = Cell.ResultStr(65)

stringRet = Cell.ResultStr("in") where "in" can also be any of the alternate strings representing inches, such as "inch", "in.", or "i".

For a complete list of valid unit strings along with corresponding Automation constants (integer values), see About units of measure.

Automation constants for representing units are declared by the Visio type library in member VisUnitCodes.

Passing a zero (0) is sufficient for getting the value of text string cells.

You can use the ResultStr property to convert between units. For example, you can get the value in inches, then get an equivalent value in centimeters.

The ResultStr property is useful for filling controls such as edit boxes with the value of a cell.