Cell.ResultStrU Property
Visio Automation Reference |
Gets the value of a ShapeSheet cell expressed as a universal string. Read-only.
Version Information
Version Added: Visio 2007
Syntax
expression.ResultStrU(UnitsNameOrCode)
expression An expression that returns a Cell object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
UnitsNameOrCode | Required | Variant | The units to use when retrieving the value. |
Return Value
String
Remarks
Getting the ResultStrU property is similar to getting a cell's Result property. The difference is that the ResultStrU 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.
stringReturned = Cell.ResultStrU(visInches)
stringReturned = Cell.ResultStrU(65)
stringReturned = Cell.ResultStrU("in") where "in" can also be any of the alternate strings representing inches, such as "inch", "in.", or "intCounter".
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 ResultStrU property to convert between units. For example, you can get the value in inches and then get an equivalent value in centimeters.
The ResultStrU property is useful for filling controls such as edit boxes with the value of a cell.
Note |
---|
Beginning with Microsoft Visio 2000, you can use both local and universal names to refer to Visio shapes, masters, documents, pages, rows, add-ons, cells, hyperlinks, styles, fonts, master shortcuts, UI objects, and layers. When a user names a shape, for example, the user is specifying a local name. Beginning with Microsoft Office Visio 2003, the ShapeSheet spreadsheet displays only universal names in cell formulas and values. (In prior versions, universal names were not visible in the user interface.) |
As a developer, you can use universal names in a program when you don't want to change a name each time a solution is localized. Use the ResultStr property to get an object's value expressed as a locale-specific string. Use the ResultStrU property to get an object's value expressed as a universal string.
Example
This Microsoft Visual Basic for Applications (VBA) macro shows two different ways to use the ResultStrU property to get the value of a ShapeSheet cell that contains a shape data item (formerly, a custom property) .
To run this macro, open a blank drawing and the Computers and Monitors (US Units) stencil, and then insert a user form that contains a label, text box, and list box. Set the width of the list box to 150.
Note |
---|
The Computers and Monitors (US Units) stencil is available only in Microsoft Office Visio Professional. |
Visual Basic for Applications |
---|
|
See Also