Print automation in vb.net

I would like to automatically print a text file from within a button event, and also, I would like to append that text file, which is being copied from my C:\. Can anyone help My code is below. The text file I would like to print automatically and append is (test1.txt).

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim file As System.IO.StreamWriter

Dim CombineString As String

CombineString = aString & bString & cString & dString & eString & fString & hString & kString & iString & jString & lString

file = My.Computer.FileSystem.OpenTextFileWriter("C:\test.txt", True, System.Text.Encoding.ASCII)

file.WriteLine(CombineString)

file.Close()

My.Computer.FileSystem.CopyFile("C:\test.txt", _

"C:\SaveDocs\test1.txt", Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, FileIO.UICancelOption.DoNothing)

End Sub




Answer this question

Print automation in vb.net