Framework EDI Reference. Methods and Properties
ediDataSegment. DataElementValueByPos

Gets or sets the value of a data element whose location is specified by the hierarchical string.

Syntax:

Parameters:

Remark

This method is only supported when the Cursor Type is set to Dynamic.  When locating the data segment, the process may page to disk and degrade performance, especially for large files.

Example 1: Getting a value

Dim oDataSegment As Fredi.ediDataSegment
Dim sValue As String

....

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

' Get the value of the data element located by a hierarchy string.
sValue = oDataSegment.DataElementValueByPos("\ISA\GS\ST\BEG<373>")

' Get the value from the file object.
MsgBox "Element Value: " & sValue

Example 2: Setting a value

Dim oDataSegment As Fredi.ediDataSegment

....

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

' Set the value of the data element located by a hierarchy string.
oDataSegment.DataElementValueByPos("\ISA\GS\ST\BEG<373>") = "20051205"

' Show new value of data element.
MsgBox "Element Value: " & oDataSegment.DataElementValueByPos("\ISA\GS\ST\BEG<373>")

Sample

P_DataElementValueByPos.zip