Private Sub cmdTxt_Click()
cdlgIntro.CancelError = True
With cdlgIntro
.Filter = "文本文件(*.txt)|*.txt"
.ShowSave
strDbf = .FileName
End With
Open strDbf For Output As #1
For i = 1 To hang '所需要的行数
DataGrid1.Book = i
If DataGrid1.Columns.Item(0) <> "" Then
Print #1, DataGrid1.Columns.Item(0) & "——" & DataGrid1.Columns.Item(1)
End If
Next i
Close #1
MsgBox "当前显示文本输出成功!", vbInformation, "提示"
End Sub
cdlgIntro.CancelError = True
With cdlgIntro
.Filter = "文本文件(*.txt)|*.txt"
.ShowSave
strDbf = .FileName
End With
Open strDbf For Output As #1
For i = 1 To hang '所需要的行数
DataGrid1.Book = i
If DataGrid1.Columns.Item(0) <> "" Then
Print #1, DataGrid1.Columns.Item(0) & "——" & DataGrid1.Columns.Item(1)
End If
Next i
Close #1
MsgBox "当前显示文本输出成功!", vbInformation, "提示"
End Sub
解决方案 »
- vb多文件选择控件选择
- 请教如何将数字,比如:1003.56 加密后,显示为字符.
- VB获取的MAC为什么是00-00-00-00-00-00??
- ADO的Recordset.Seek方法怎么用啊?
- 怎么判断DataGrid控件的当前行?
- 关于VB控制EXCEL菜单的问题
- 简单问题,可是我不会 :(
- 在Win98下可以用SetWindowWord(Me.hwnd, -8, frmMain.hwnd)使一个窗口位于本程序所有窗口之上,但是在Win2000下就不行了,请问该如何调用?注意不是所有窗口,是本程序。
- 那里有webbrowser空件的详细中文解说
- 精密导线平差程序设计探讨
- 请问WinExec和SHELL有什么不同之处?
- 求vb解析xml的资料...
cdlgIntro.CancelError = True
With cdlgIntro
.Filter = "文本文件(*.txt)|*.txt"
.ShowSave
strDbf = .FileName
End With
Open strDbf For Output As #1
For i = 1 To hang '所需要的行数
DataGrid1.Book = i
Print #1, DataGrid1.Columns.Item(0) & "——" & DataGrid1.Columns.Item(1)
Next i
Close #1
MsgBox "当前显示文本输出成功!", vbInformation, "提示"
End Sub是这个,上边的是我现在所调试的程序用的。
"cdlgIntro"应该是你定义的变量吧?这个变量是什么类型呢?
"文本文件(*.txt)|*.txt"又是什么意思呢?
请您指点一下,谢谢!!!
DataGrid1.Book = i
类型不匹配???