要分配给数据列属性的值。有关可能值，请参阅“说明”。The value to assign the data-column property. See Remarks for possible values.

返回值Return Value

无Nothing

注解Remarks

在将 Microsoft Visio 绘图中的形状链接到某一数据记录集内的数据时，Visio 会将该数据记录集内的列映射到 ShapeSheet 电子表格的“形状数据”部分中的行，其中每一行均与一个形状数据项相对应。When you link shapes in a Microsoft Visio drawing to data in a data recordset, Visio maps columns in the data recordset to rows in the Shape Data section of the ShapeSheet spreadsheet, each of which corresponds to a shape-data item.

请注意 在某些 Visio 的早期版本中，形状数据被称为自定义属性。Note In some previous versions of Visio, shape data were called custom properties.

数据列属性映射到形状表形状数据部分中的某些单元格的数据列。例如，通过由枚举的值visDataColumnPropertyDisplayName ，显示名称属性的新值传递SetProperty方法设置标签的单元格的值中的形状数据部分特定的形状数据项的形状表。此外，将该属性设置在形状数据对话框中，以及在 Visio 用户界面中外部数据窗口中显示的数据列的名称设置该形状数据项的标签。这些设置对应于可以在 Visio 用户界面中的列设置对话框中设置 （在外部数据窗口中右键单击，然后单击列设置），以及那些可以使类型中和单位的每个列的对话框中 （单击数据类型列设置对话框中）。Data-column properties map data columns to certain cells in the Shape Data section of the ShapeSheet. For example, by passing the SetProperty method a new value for the DisplayName property, which is represented by the enumerated value visDataColumnPropertyDisplayName , you set the value of the Label cell in the Shape Data section of the ShapeSheet for a particular shape data item. In addition, setting that property sets the label of the shape data item in the Shape Data dialog box, as well as the name of the data column that is displayed in the External Data window in the Visio user interface. These settings correspond to those that you can set in the Column Settings dialog box in the Visio user interface (right-click in the External Data window and then click Column Settings), as well as those that you can make in the Types and Units dialog box for each column (click Data Types in the Column Settings dialog box.)

属性参数的可能值在VisDataColumnProperties ，声明，如下表所示。Possible values for the Property parameter are declared in VisDataColumnProperties , and are shown in the following table.

常量Constant

值Value

说明Description

* * visDataColumnPropertyCalendar * * visDataColumnPropertyCalendar**

33

数据列属性的日历。Calendar of the data-column property.

visDataColumnPropertyCurrencyvisDataColumnPropertyCurrency

55

数据列属性的货币。Currency of the data-column property.

visDataColumnPropertyDisplayNamevisDataColumnPropertyDisplayName

66

数据列属性在用户界面中的显示名称。Display name of the data-column property in the UI.

visDataColumnPropertyHyperlinkvisDataColumnPropertyHyperlink

88

数据列值在链接到形状时，是否成为 Visio 用户界面中的超链接。Whether the data-column value becomes a hyperlink in the Visio UI when it is linked to a shape.

visDataColumnPropertyLangIDvisDataColumnPropertyLangID

22

数据列属性的语言 ID。Language ID of the data-column property.

visDataColumnPropertyTypevisDataColumnPropertyType

11

数据列属性的数据类型。Data type of the data-column property.

visDataColumnPropertyUnitsvisDataColumnPropertyUnits

44

数据列属性的单位。Units of the data-column property.

visDataColumnPropertyVisiblevisDataColumnPropertyVisible

77

数据列属性是否在用户界面中可见。Whether the data-column property is visible in the UI.

属性参数值取决于 Value 参数的可能值。下表显示每个数据列属性，具体取决于数据列数据类型有效的数据列属性值。Possible values for the Value parameter depend on the Property parameter value. The following table shows valid data-column property values for each data-column property, depending on the data-column data type.

其中一种VisUnitsCodes的下列成员：OR Descriptive string?a string used for units, such as cm or sq cm . This string will be validated so that it is one of the supported Visio units. Passing invalid strings causes the method to fail.

示例Example

下面的 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用替代方法来获取传递给该方法的数据记录集中的第一列形状数据部分中的标签单元格的值并将其显示在即时窗口。然后它使用SetProperty方法设置的值，并显示新值。更改这个值的更改标签的形状数据项在形状数据对话框中的所有形状链接到数据记录集中的行。The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the GetProperty method to get the value of the Label cell in the Shape Data section for the first column in the data recordset passed to the method and display it in the Immediate window. Then it uses the SetProperty method to set the value and displays the new value. Changing this value changes the label of the shape data item in the Shape Data dialog box for all shapes linked to rows in the data recordset.

获取和设置标签的单元格值，宏传递visDataColumnPropertyDisplayName值VisDataColumnProperties枚举的DataColumn.GetProperty和DataColumn.SetProperty的方法。To get and set the Label cell value, the macro passes the visDataColumnPropertyDisplayName value from the VisDataColumnProperties enumeration to the DataColumn.GetProperty and DataColumn.SetProperty methods.

在运行这个宏之前，至少要在 VBA 项目中创建一个要传递给这个宏的数据记录集。Before running this macro, create at least one data recordset in your VBA project to pass to the macro.