Framework EDI Reference. Methods and Properties
ediDataElements. DataElement

Gets the data element member in the collection.

Syntax:

Parameters:

Returns

Returns an object of type FREDI.ediDataElement; otherwise empty object or NULL.

Remarks

This property gets the data element, or composite element, belonging to a collection of elements in a data segment or composite element.  Or gets a component element belonging to a collection of component elements in a composite element. If the parameter is less than one, or exceeds the number of items in the collection, then the property returns an empty object.

If lSubElementPosition is not specified, or zero, the object returned is a data element or a composite element.  Otherwise, if it is greater than one, the object returned is a component element in position lSubElementPosition of a composite element.

If lRepeatInstance is not specified, or zero, the repeating instance requested of the object defaults to one, which is the first repeating instance of the element located by lElementPosition and lSubElementPosition.

Example

Dim oDataElements As Fredi.ediDataElements
Dim oDataSegment As Fredi.ediDataSegment

....

' Get first data segment in document.
Set oDataSegment = oEdiDoc.FirstDataSegment

' Get the data segment.
Set oDataSegment = oDataSegment.GetDataSegmentByPos("\ISA\GS\ST\BEG")

' Get the object containing the collection of data elements.
Set oDataElements = oDataSegment.DataElements

For i = 1 To oDataElements.Count

Dim oDataElement As Fredi.ediDataElement

Set oDataElement = oDataElements.DataElement(i)

' Show some element properties.
sElements = sElements & oDataElement.Position & vbTab & oDataElement.ID & vbTab & oDataElement.Description & vbCrLf
Next

Sample

M_DataElement.zip