06/01/2019, 00:28
biocsi
(04/01/2019, 11:08)ozanakkaya yazdı: Kodu aşağıdaki ile değiştirerek dener misin?
Dim GGecerliBelgeYolu, GSablonYolu As String
Dim WordApp, oWdoc As Object
GSablonYolu = CurrentProject.Path & "\ornek.dotx"
GGecerliBelgeYolu = CurrentProject.Path & "\" & Me.Kimlik & ".docx"
If Me.otobüs_araba = 0 Then
GVeri = "Otobüsle"
Else
GVeri = "Arabayla"
End If
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True
WordApp.Activate
WordApp.WindowState = wdWindowStateMaximize
Set oWdoc = WordApp.Documents.Add(Template:=GSablonYolu, NewTemplate:=False)
WordApp.ActiveDocument.Bookmarks("sonuc").Select
WordApp.Selection.Text = GVeri
oWdoc.SaveAs2 GGecerliBelgeYolu