Framework EDI Reference. Methods and Properties
ediDataElement. ExportValue

Exports the value of a data element to an external file.

Syntax:

Parameters:

Returns

Returns 1 if the operation is successful; otherwise the operation returns zero.

Example


Dim oEdiDoc As Fredi.ediDocument
Dim oSchemas As Fredi.ediSchemas
Dim oSchema As Fredi.ediSchema
Dim oDataElement As Fredi.ediDataElement
Dim oDataSegment As Fredi.ediDataSegment

' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument

' Disable standard reference library.
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False

' Load the schema that the EDI file will use.
Set oSchema = oEdiDoc.LoadSchema(App.Path & "\SampleSefX12_850.SEF", Schema_Standard_Exchange_Format)

' Process the EDI file.
oEdiDoc.LoadEdi App.Path & "\SampleEdiX12_850.X12"

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

' Get the data element that is the 5th position of the BEG data segment.
Set oDataElement = oDataSegment.GetDataElementByPos("\ISA\GS\ST\BEG<373>")

' Export the value of the data element to a file.
oDataElement.ExportValue App.Path & "\ExportFile.TXT"

MsgBox "Done"

Sample

M_ExportValue.zip