26-08-18, 11:13 PM
جرب هذا الكود
PHP كود :
Private Sub Command1_Click()
Dim txt As String
Open App.Path & "\attachment.txt" For Input As 1
txt = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
Dim arr() As String
arr = Split(txt, vbNewLine)
With MSFlexGrid1
.Rows = 1
Dim t As Variant
For Each t In arr
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = Mid$(t, 1, 7)
.TextMatrix(.Rows - 1, 1) = Mid$(t, 10, 21)
.TextMatrix(.Rows - 1, 2) = Mid$(t, 32, 4)
.TextMatrix(.Rows - 1, 3) = Mid$(t, 39, 7)
.TextMatrix(.Rows - 1, 4) = Mid$(t, 48, 2)
.TextMatrix(.Rows - 1, 5) = Mid$(t, 52, 3)
Next
.Rows = .Rows - 1
End With
End Sub