Framework EDI Reference. Methods and Properties
ediDataElements. Last

Gets the last data element from the collection.

Syntax:

Returns

Returns an object of type FREDI. ediDataElement.

Example

Dim oDataElement As Fredi.ediDataElement
Dim oComposite As Fredi.ediDataElement
Dim oAllElements As Fredi.ediDataElements
Dim oDataSegment As Fredi.ediDataSegment

....

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

' Get the composite element.
Set oComposite = oDataSegment.GetDataElementByPos("\ISA\GS\ST\PO1\SLN\SLN<C001>")

' Get the object containing the collection of sub elements.
Set oAllElements = oComposite.DataElements

' Get the last element in the collection.
Set oDataElement = oAllElements.Last

MsgBox "Last element in the collection is " & oDataElement.ID

Sample

M_Last.zip