Output of the contents of the MSFlexGRID control to the text

xiaoxiao2021-03-06  104

'OutDataTotext

'Output content displayed in the MSFlexGRID control to text files

Public Sub OutDataTotext (Flex As MsflexGrid)

DIM S As String

DIM I as integer

DIM J AS INTEGER

DIM K As Integer

DIM STRTEMP AS STRING

ON Error Goto Ort

Me.MousePointer = 11

ON Error ResMe next

Doevents

DIM Filenum as in

FILENUM = Freefile

Open "d: /aa.txt" for output as #filenum

With flex

K = .rows

For i = 0 to k - 1

strTemp = ""

For j = 0 to .cols - 1

Doevents

Strtemp = Strtemp & .TextMatrix (i, j) & ","

NEXT J

Print #filenum, Left (strTemp, Len (Strtemp) - 1)

Next i

End with

Close #filenum

Me.MousePointer = 0

Msgbox "Export Success"

ERT:

MsgBox Err.Description

Me.MousePointer = 0

End Sub

转载请注明原文地址:https://www.9cbs.com/read-124550.html

New Post(0)