AddCustomField[U] method

Microsoft Visio Developer Reference

AddCustomField[U] method

   Example   

Replaces the text represented by a Characters object with a custom formula field.

Version added

3.0

Syntax

object.AddCustomField strFormula, intFormat

object

Required. An expression that returns a Characters object.

strFormula

Required String. The formula of the new field.

intFormat

Required Integer. The format of the new field.

Remarks

Using the AddCustomField method is similar to clicking Field on the Insert menu and inserting a custom formula field in text. To add any other type of field (not custom), use the AddField method.

For a list of valid field format constants, see the FieldFormat property. Valid field format constants are also defined in the Visio type library in VisFieldFormats.

Note Beginning with Visio 2000, you can refer to Visio shapes, masters, styles, pages, rows, and layers using local and universal names. When a user names a shape, for example, the user is specifying a local name. Universal names are not visible through 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 AddCustomField method to set a custom field using local syntax. Use the AddCustomFieldU method to set a custom field using universal syntax.