VB编程保存的代码怎么输

来源:百度知道 编辑:UC知道 时间:2024/06/05 12:38:40
应该是Private Sub MenSave _ Click ()
之后要怎么写啊

以下代码主要是针对文本文档和word文档的文字的 方式为顺序存取 先拿去试试,不好就不要给分 我是新手

Private Sub Mensave_Click()
If Form1.Caption = "无标题" Then
mnu_resave_Click 1
Else
num = FreeFile
Open Form1.Caption For Output As #num
Print #num, Text1

Close (num)
End If

1
mnu_resave_Click

CommonDialog1.Filter = "(txt 文档)|*.txt|(doc 文档)|*.doc"
CommonDialog1.ShowSave
f2 = CommonDialog1.FileName
num = FreeFile
Open f2 For Output As #num
Print #num, Text1
Close (num)
Form1.Caption = f2

保存什么?
给你点提示:保存到文件:先用open...for...打开文件,再用print/write/randomize/其他方式写入,用input/randomize/其他方式读出

你要说具体保存什么内容,什么方式保存。