Deskripsi
Tentang penjualan macam-macam Jus Buah menggunakan Visual
Studio 2013 dan Qutput menggunakan Word
Imports word = Microsoft.Office.Interop.Word
Public Class Form1
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub
RadioButton2_CheckedChanged(sender As
Object, e As EventArgs)
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
Private Sub
CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
End Sub
Private Sub
CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox3.Text = TextBox1.Text * TextBox2.Text
End Sub
Private Sub
CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
End Sub
Private Sub CheckBox1_MouseClick(sender As Object, e As MouseEventArgs) Handles CheckBox1.MouseClick
PictureBox1.Image = System.Drawing.Image.FromFile("C:\Users\hp\Documents\Visual Studio 2013\Projects\EFRIL01\Jus
Mangga.jpg")
TextBox1.Text = "11000"
CheckBox2.Checked = False
CheckBox1.Checked = True
CheckBox3.Checked = False
End Sub
Private Sub CheckBox2_MouseClick(sender As Object, e As MouseEventArgs) Handles CheckBox2.MouseClick
PictureBox1.Image = System.Drawing.Image.FromFile("C:\Users\hp\Documents\Visual Studio 2013\Projects\EFRIL01\Jus
Alpukat.jpg")
TextBox1.Text = "12000"
CheckBox2.Checked = True
CheckBox1.Checked = False
CheckBox3.Checked = False
End Sub
Private Sub CheckBox3_MouseClick(sender As Object, e As MouseEventArgs) Handles CheckBox3.MouseClick
PictureBox1.Image = System.Drawing.Image.FromFile("C:\Users\hp\Documents\Visual Studio 2013\Projects\EFRIL01\Jus
Jeruk.jpg")
TextBox1.Text = "10000"
CheckBox2.Checked = False
CheckBox1.Checked = False
CheckBox3.Checked = True
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim aplikasi As New word.Application
Dim file As New word.Document
file = aplikasi.Documents.Open("C:\Users\hp\Documents\Visual Studio
2013\Projects\EFRIL01\Struk Efril.dotx")
If CheckBox3.Checked Then
file.Bookmarks("NAMA").Select()
aplikasi.Selection.TypeText(CheckBox3.Text)
ElseIf CheckBox2.Checked Then
file.Bookmarks("NAMA").Select()
aplikasi.Selection.TypeText(CheckBox2.Text)
ElseIf CheckBox1.Checked Then
file.Bookmarks("NAMA").Select()
aplikasi.Selection.TypeText(CheckBox1.Text)
End If
file.Bookmarks("HARGA").Select()
aplikasi.Selection.TypeText(TextBox1.Text)
file.Bookmarks("JUMLAH").Select()
aplikasi.Selection.TypeText(TextBox2.Text)
file.Bookmarks("TOTAL").Select()
aplikasi.Selection.TypeText(TextBox3.Text)
file.SaveAs2("C:\Users\hp\Documents\Visual Studio 2013\Projects\EFRIL01\Struk
Efril\Struk Efril.dotx")
aplikasi.Visible = True
End Sub
Private Sub Label4_Click(sender As Object, e As EventArgs) Handles Label4.Click
End Sub
End Class