ResultInt property

Microsoft Visio Developer Reference

ResultInt property

   Example   

Gets the value of a cell expressed as an integer.

Version added

4.0

Syntax

intRet = object.ResultInt(unitsNameOrCode,roundFlag)

intRet

Long. The cell's value returned as an integer.

object

Required. An expression that returns a Cell object.

unitsNameOrCode

Required Variant. The units to use when retrieving the cell's value.

roundFlag

Required Integer. Zero (0) to truncate the value; non-zero to round it.

Remarks

Setting the ResultInt property is similar to a setting a cell's Result property. The difference is that the ResultInt property returns an integer 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.

intRet = Cell.ResultInt(visInches, roundFlag)

intRet = Cell.ResultInt(65, roundFlag)

intRet = Cell.ResultInt("in", roundFlag) 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.

The following constants for roundFlag are declared in the Visio type library in member VisRoundFlags.

Constant

Value

Description

visTruncate

0

Truncate the result

visRound

1

Round the result