VarType.NewSubItem



NewSubItem(bReferenz As Boolean,pBaseType As VarType,bstrTypeName As String,lDim1 As Long,lDim2 As Long,lDim3 As Long,lLBound As Long) As ComplexItem

Parameters

bReferenz As Boolean
Set false for a embedded datatype and true for a linked one.
pBaseType As VarType
A VarType object which defines the basic type of the element.
bstrTypeName As String
A string which defines the name of the element.
lDim1 As Long
Set the number of elements for the first array dimension.
lDim2 As Long
Set the number of elements for the second array dimension.
lDim3 As Long
Set the number of elements for the third array dimension.
lLBound As Long
Set the array start index (0 or 1).
ED
avaliable
RT
not used

Remarks

With this method you can create new sub items for a structure datatype.

Sample:


Sub NewSubItem()

Dim zVarTypes As VarTypes   'Object from type VarTypes
Dim zVarType As VarType 'Child object from type VarTypes
Dim zVarType_1 As VarType   'Child object from type VarTypes
Dim zDrivers As Drivers 'Object from type Drivers
Dim zComplexItem As ComplexItem 'Child object from type ComplexItem

'Fill the objects
Set zVarTypes = MyWorkspace.ActiveDocument.VarTypes

'Read the own created structure datatype "struct"
Set zVarType = zVarTypes.Item("struct")
'Read the INT datatype as base type for the structure element
Set zVarType_1 = zVarTypes.Item("INT")
'Create a new structure element called "Element_1" from type INT which should be embedded
Set zComplexItem = zVarType.NewSubItem("Element_1", zVarType_1, False, 0, 0, 0, 0)

End Sub

See Also

VarType, ComplexItem