VB记事本保存文件代码问题
我只是做了一个简易的,只有文本框和保存,但是以下代码无效PrivateSubCommand1_Click()DimiAsIntegerDimppAsStringCommo...
我只是做了一个简易的,只有文本框和保存,但是以下代码无效
Private Sub Command1_Click()
Dim i As Integer
Dim pp As String
CommonDialog1.Filter = "文档文件(*.txt)|*.txt|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
If CommonDialog1.CancelError Then Exit Sub
If CommonDialog1.FileName = "" Then Exit Sub
Open CommonDialog1.FileName For Output As #1
pp = Mid(Text1.Text, 1, Len(Text1.Text))
Print #1, pp
Close
MsgBox "Export Successfully!"
End Sub
界面就是这样 展开
Private Sub Command1_Click()
Dim i As Integer
Dim pp As String
CommonDialog1.Filter = "文档文件(*.txt)|*.txt|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
If CommonDialog1.CancelError Then Exit Sub
If CommonDialog1.FileName = "" Then Exit Sub
Open CommonDialog1.FileName For Output As #1
pp = Mid(Text1.Text, 1, Len(Text1.Text))
Print #1, pp
Close
MsgBox "Export Successfully!"
End Sub
界面就是这样 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询