Output content displayed in the MSFlexGRID control to a text file

zhaozj2021-02-17  47

'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-29796.html

New Post(0)