Framework EDI Reference. Methods and Properties
ediSchemas. GetSchemaByHandle

Gets the schema object using the handle of the schema.

Syntax:

Returns

Returns an object of type FREDI.ediSchema that has the handle requested.

Remarks

All schema objects contain a handle that is unique and different to all other objects created during the processing of a document. The GetSchemaByHandle method can get any of the schema objects by passing the handle of the schema.

Example

Dim oEdiDoc As ediDocument
Dim oSchemas As ediSchemas
Dim oSchema As ediSchema
Dim oSchema2 As ediSchema
Dim lSchemaHandle As Long
Dim sEdiFile As String
Dim sSefFile As String

sEdiFile = App.Path & "\850.X12"
sSefFile = App.Path & "\850.SEF"

Set oEdiDoc = New ediDocument
Set oSchema = oEdiDoc.LoadSchema(sSefFile, 0)
Set oSchemas = oEdiDoc.GetSchemas

oEdiDoc.LoadEdi sEdiFile

‘ Get the handle of the schema
lHandle = oSchema.Handle

‘ Now get the schema by passing the handle of the schema to the method
Set oSchema2 = oSchemas.GetSchemaByHandle(lHandle)
Debug.Print "Schema Handle: " & oSchema2.Handle
Debug.Print "Schema Version: " & oSchema2.Version
Debug.Print "Schema Industry: " & oSchema2.Industry
Debug.Print "Schema Version: " & oSchema2.StandardVersion