Private Sub Command1_Click() '打开
    CommonDialog1.ShowOpen
    If CommonDialog1.filename <> "" Then
        Open CommonDialog1.filename For Binary As #1
            Text1.Text = Input(LOF(1), 1)
        Close #1
    End If
End SubPrivate Sub Command2_Click() '保存
    CommonDialog1.ShowSave
    If CommonDialog1.filename <> "" Then
    Open CommonDialog1.filename For Output As #1
        Print #1, Text1.Text
    Close #1
    End If
End SubPrivate Sub Command3_Click() '新建
    Text1.Text = ""
End Sub

解决方案 »

  1.   

    Private Sub Command2_Click() '保存
        CommonDialog1.Filter = "(*.txt)|*.txt|(*.*)|*.*|" '补充补充补充补充补充补充补充
        CommonDialog1.ShowSave
        If CommonDialog1.FileName <> "" Then
        Open CommonDialog1.FileName For Output As #1
            Print #1, Text1.Text
        Close #1
        End If
    End Sub
      

  2.   

    只是只能打开我的记事本保存的文件,
            Open CommonDialog1.filename For Binary As #1
                Text1.Text = Input(LOF(1), 1)
            Close #1
    这个就是读文本用的请问:你要达到什么目的?
    qq:26603030