Hari ini, saya akan menunjukkan tutorial Visual Studio 2012, Dimana pada post kali ini, akan ada cara untuk membuat koneksi antara Visual Studio 2012 dengan Microsoft Office Word dan Microsoft Office Excel,
Well,, without further ado, LET THE GAME BEGIN !!!
Explanation...
This Application is Made to be an alternative version for Fingerprint Absent Machine
Connected to MS Word (As a Reference to Each Personnel)
Connected to MS Excel (As a Reference to All Personnel)
In MS Word, the interface shown is Vertical
In MS Excel, the interface shown is Horizontal
File Name can be changed as needed for MS Word / MS Excel
At the Form, there are "ID Karyawan","Nama Karyawan","Jabatan Karyawan","Jumlah Hari Hadir","Jumlah Hari Tidak Hadir","Jumlah Hari Kerja dalam 1 Bulan"
Made to make it easier when there are difference in Fingerprint result and Application result
Can be used as a reference to calculate Gross Salary
Here's the Source Code =D
SOURCE CODE START HERE !!!
IMPORTS
Imports excel = Microsoft.Office.Interop.Excel
Imports Word = Microsoft.Office.Interop.Word
Imports System.Data
Imports System.Data.OleDb
WORD
Dim Aplikasi As New Word.Application
Dim Dokumen As Word.Document
Dim FilePath As String
Dokumen = Aplikasi.Documents.Open("C:\Users\user\Desktop\Kul\Web2\UTS.docx")
Dokumen.Bookmarks("ID").Select()
Aplikasi.Selection.TypeText(tbID.Text)
Dokumen.Bookmarks("Nama").Select()
Aplikasi.Selection.TypeText(tbNAMA.Text)
Dokumen.Bookmarks("JabKar").Select()
Aplikasi.Selection.TypeText(tbJABKAR.Text)
Dokumen.Bookmarks("JHHadir").Select()
Aplikasi.Selection.TypeText(tbJHHADIR.Text)
Dokumen.Bookmarks("JHTHadir").Select()
Aplikasi.Selection.TypeText(tbJTHADIR.Text)
Dokumen.Bookmarks("JHK1B").Select()
Aplikasi.Selection.TypeText(tbJHK1B.Text)
`Untuk mengganti nama File, cukup mengganti angka dibelakang UTS
FilePath = "C:\Users\user\Desktop\Kul\Web2\UTS1.docx"
Dokumen.SaveAs2(FilePath)
MsgBox("Success")
Aplikasi.Visible = True
EXCEL
Dim AplikasiExcel As New excel.Application
Dim DocumentExcel As excel.Workbook
Dim FilePath As String
DocumentExcel = AplikasiExcel.Workbooks.Open("C:\Users\user\Desktop\Kul\Web2\UTS.xlsx")
AplikasiExcel.Range("A2").Value = tbID.Text
AplikasiExcel.Range("B2").Value = tbNAMA.Text
AplikasiExcel.Range("C2").Value = tbJABKAR.Text
AplikasiExcel.Range("D2").Value = tbJHHADIR.Text
AplikasiExcel.Range("E2").Value = tbJTHADIR.Text
AplikasiExcel.Range("F2").Value = tbJHK1B.Text
`Untuk mengganti nama File, cukup mengganti angka dibelakang UTS
FilePath = "C:\Users\user\Desktop\Kul\Web2\UTS1.xlsx"
DocumentExcel.SaveAs(FilePath)
MsgBox("Success")
AplikasiExcel.Visible = True
SOURCE CODE END HERE !!!
And Here's the SS from Browser
And Another SS From Word
At Last but not Least, SS from Excel
Well,, that's that brothers and sisters,
Please stay tune, next time we met, i'm gonna post an endangering tutorial,,
Thank you for your visit,,, G'Bye =D=D
No comments:
Post a Comment