Kodu aşağıdaki gibi yazdım olmadı.
Alıntı:Option Compare Database[/vb]
Private Sub Komut22_Click()
' Word Şablonundan yeni belge oluşturma.
Dim WordApp As Word.Application
Dim strTemplateLocation As String
' Şablonun bulunduğu yer
strTemplateLocation = CurrentProject.Path & "\talepmernis.dot"
On Error Resume Next
Set WordApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set WordApp = CreateObject("Word.Application")
End If
On Error GoTo ErrHandler
WordApp.Visible = True
WordApp.WindowState = wdWindowStateMaximize
WordApp.Documents.Add Template:=strTemplateLocation, NewTemplate:=False
' Her satırı uygun olan kayıt ile değiştirmek.
With WordApp.Selection
.Goto what:=wdGoToBookmark, Name:="icradairesi"
.TypeText [VERİTABANI]![İcra Dairesi]
.Goto what:=wdGoToBookmark, Name:="esasno"
.TypeText [VERİTABANI]![Esas No]
.Goto what:=wdGoToBookmark, Name:="adisoyadi"
.TypeText [VERİTABANI]![Adı Soyadı]
.Goto what:=wdGoToBookmark, Name:="tcno"
.TypeText [VERİTABANI]![Tc veya Vergi no]
End With
DoEvents
WordApp.Activate
Set WordApp = Nothing
Exit Sub
ErrHandler:
Set WordApp = Nothing
End Sub
Private Sub Komut140_Click()
End Sub