- Katılım
- 4 Ekim 2004
- Mesajlar
- 155
İstediğim şey "Şablon dosyasında "kararlar" diye bir başlık var.
Excel'de Userform3.textbox1'e girilen metni, word dosyasında 2.sayfada yer alan "kararlar" başlığı altında yazması.
nasıl yaparız? Aşağıdaki kodun neresini revize etmem gerek? acaba yardımcı olurmusunuz?
Private Sub CommandButton1_Click()
Set wdApp = CreateObject("word.Application")
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Open(ThisWorkbook.Path & "\" & "Sablon.docx")
If wdApp.Selection.Information(4) < 2 Then
wdApp.Selection.EndKey Unit:=6
wdApp.Selection.InsertNewPage
Else
wdApp.Selection.GoTo What:=1, Which:=2, Name:="Kararlar"
wdApp.Selection.MoveDown Unit:=4, Count:=1
End If
wdApp.Selection.TypeText Text:=UserForm3.TextBox1.Text
End Sub
Excel'de Userform3.textbox1'e girilen metni, word dosyasında 2.sayfada yer alan "kararlar" başlığı altında yazması.
nasıl yaparız? Aşağıdaki kodun neresini revize etmem gerek? acaba yardımcı olurmusunuz?
Private Sub CommandButton1_Click()
Set wdApp = CreateObject("word.Application")
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Open(ThisWorkbook.Path & "\" & "Sablon.docx")
If wdApp.Selection.Information(4) < 2 Then
wdApp.Selection.EndKey Unit:=6
wdApp.Selection.InsertNewPage
Else
wdApp.Selection.GoTo What:=1, Which:=2, Name:="Kararlar"
wdApp.Selection.MoveDown Unit:=4, Count:=1
End If
wdApp.Selection.TypeText Text:=UserForm3.TextBox1.Text
End Sub
