03/01/2013, 13:18
aşağıdaki gibi oluyor
Sub toWord()
Dim WordApp As Word.Application
Dim doc As Word.Document
Dim sel As Word.Selection
Set WordApp = New Word.Application
WordApp.Documents.Add
Set doc = WordApp.ActiveDocument
Set sel = WordApp.Selection
WordApp.Visible = True
dilekceKonusu = sicili & " sicil sayılı " & adı & " " & soyadı & " " & [izin tarihi] & " tarihinden geçerli " _
& [izin süresi] & " gün senelik iznini " & [izin adresi] & " 'nde geçirmek üzere ayrılma talebinde bulunmuştur"
With WordApp
.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Selection.TypeText Text:=".........................................TC KAYMAKAMLIĞI"
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Selection.TypeText Text:="Tarih : " & Date
.Selection.TypeParagraph
.Selection.TypeText Text:="Sayı : " & 111111
.Selection.TypeParagraph
.Selection.TypeText Text:="Konu : " & adı & " , " & soyadı
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Selection.TypeText Text:=".........................................ŞUBE MÜDÜRLÜĞÜNE"
.Selection.TypeParagraph
.Selection.TypeParagraph: .Selection.TypeText Text:=vbTab
.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=sicili
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" sicil sayılı "
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=adı & " " & soyadı & " " & [izin tarihi]
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" tarihinden geçerli "
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=[izin süresi]
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" gün senelik iznini "
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=[izin adresi]
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" 'nde geçirmek üzere ayrılma talebinde bulunmuştur"
.Selection.TypeParagraph: .Selection.TypeText Text:=vbTab
.Selection.TypeText Text:="Gereğini arz ederim."
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
.Selection.TypeText Text:="Birim Amiri"
End With
End Sub
Sub toWord()
Dim WordApp As Word.Application
Dim doc As Word.Document
Dim sel As Word.Selection
Set WordApp = New Word.Application
WordApp.Documents.Add
Set doc = WordApp.ActiveDocument
Set sel = WordApp.Selection
WordApp.Visible = True
dilekceKonusu = sicili & " sicil sayılı " & adı & " " & soyadı & " " & [izin tarihi] & " tarihinden geçerli " _
& [izin süresi] & " gün senelik iznini " & [izin adresi] & " 'nde geçirmek üzere ayrılma talebinde bulunmuştur"
With WordApp
.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Selection.TypeText Text:=".........................................TC KAYMAKAMLIĞI"
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Selection.TypeText Text:="Tarih : " & Date
.Selection.TypeParagraph
.Selection.TypeText Text:="Sayı : " & 111111
.Selection.TypeParagraph
.Selection.TypeText Text:="Konu : " & adı & " , " & soyadı
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Selection.TypeText Text:=".........................................ŞUBE MÜDÜRLÜĞÜNE"
.Selection.TypeParagraph
.Selection.TypeParagraph: .Selection.TypeText Text:=vbTab
.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=sicili
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" sicil sayılı "
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=adı & " " & soyadı & " " & [izin tarihi]
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" tarihinden geçerli "
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=[izin süresi]
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" gün senelik iznini "
.Selection.Font.TextColor.RGB = vbRed: .Selection.TypeText Text:=[izin adresi]
.Selection.Font.TextColor.RGB = vbBlack: .Selection.TypeText Text:=" 'nde geçirmek üzere ayrılma talebinde bulunmuştur"
.Selection.TypeParagraph: .Selection.TypeText Text:=vbTab
.Selection.TypeText Text:="Gereğini arz ederim."
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
.Selection.TypeText Text:="Birim Amiri"
End With
End Sub