将MsFlexGrid控件中显示的内容输出到文本文件

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

'OutDataToText
'将MsFlexGrid控件中显示内容输出到文本文件
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 Ert
    Me.MousePointer = 11
    On Error Resume Next
    DoEvents
    Dim FileNum As Integer
    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 "导出成功"
Ert:
    MsgBox Err.Description
    Me.MousePointer = 0
End Sub
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: vb
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭