新建文件夹 电影:在vb中的word如何用vb语句实现复制或另存为??

来源:百度文库 编辑:高校问答 时间:2024/04/30 03:44:20
知道的麻烦写几句代码,谢谢!

设个按钮:另存为
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
'如果点击OK
Dim fs As New FileStream(SaveFileDialog1.FileName, FileMode.Create)
Dim fw As New StreamWriter(fs, Encoding.Default)
fw.BaseStream.Seek(0, SeekOrigin.End)
fw.WriteLine(TextBox1.Text)
fw.Close()
Else
'如果点击取消
TextBox1.Focus()
End If
End Sub
复制:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox1.SelectionLength > 0 Then
TextBox1.Copy()
End If

End Sub

copy(a,b)
past(a,b)