Microsoft Word Kontrolü
- Yusuf Göksu Coşkun
- 4.350
- Orta
- 22 Nisan 2011
Bu dersimizde Microsoft Office Word'e nasıl müdahale edebileceğimizi öğrenelim.
Bu dersimizde Microsoft Office Word'e nasıl müdahale edebileceğimizi öğrenelim.
Bunun için gereken butonlar:
[*] Button1 (Belge aç)
[*] Button2 (Belge kapat)
[*] Button3 (Belge kaydet)
Kodlar:
public class form1
Dim objdocument As Object
Dim objword As Object 'word programı
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
objdocument = objword.documents.add()
objword.visible = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
objdocument.close()
objword.quit()
objdocument = Nothing
objword = Nothing
Catch
MsgBox("Önce belge açmanız gerekiyor!")
Exit Sub
End Try
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
objdocument.save()
Catch
MsgBox("Önce belge açmanız gerekiyor!")
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
objword = CreateObject("Word.Application")
End Sub
Yorum yazabilmek için üye girişi yapmanız gerekiyor!