Skip to main content

AccessTr.neT


Word Şablona Vb kodları kullanarak veri göndermede kullanılabilecek notlar

bibib
bibib
2
1409

Word Şablona Vb kodları kullanarak veri göndermede kullanılabilecek notlar

#1
Arkadaşlar word şablona gönderme Vb / makro kodları kullanarak gönderme faydası olabileceğini düşündüğüm derlediğim bazı notlar

Faydası olması dileğimle


-------- Tek Satır Silmek ----------------
Selection.Delete Unit:=wdCharacter, Count:=1
‘ -------- 3 Satır işaretleyip Silmek ----------------
    Selection.MoveDown Unit:=wdLine, Count:=3, Extend:=wdExtend
    Selection.Delete Unit:=wdCharacter, Count:=1
‘ -------- Paragraf ekleyip kelime eklemek ----------------
    Selection.TypeParagraph
    Selection.TypeText Text:="Eklenecek Metin"
‘ -------- 5 Paragraf işaretleyip Kesmek ----------------
    Selection.MoveDown Unit:=wdLine, Count:=5, Extend:=wdExtend
    Selection.Cut
‘--------- Yer İmi Ekleme --------------
With ActiveDocument.Bookmarks
        .Add Range:=Selection.Range, Name:="Satır1"
        .DefaultSorting = wdSortByName
        .ShowHidden = False
 End With
        Selection.TypeParagraph
        With ActiveDocument.Bookmarks
            .Add Range:=Selection.Range, Name:="Satır2"
            .DefaultSorting = wdSortByName
            .ShowHidden = False
    End With
‘------------ Yer İmi Silme
ActiveDocument.Bookmarks("Satır2").Delete
    With ActiveDocument.Bookmarks
        .DefaultSorting = wdSortByName
        .ShowHidden = False
    End With
‘------------- Yer İmine Gitmek ----------------
    Selection.GoTo What:=wdGoToBookmark, Name:="Satır2"
    With ActiveDocument.Bookmarks
        .DefaultSorting = wdSortByName
        .ShowHidden = False
    End With
‘------- Cümlenin başı sonu kelime ekleme 
    Selection.HomeKey Unit:=wdLine
    Selection.TypeText Text:="Başa Git "
    Selection.EndKey Unit:=wdLine
    Selection.TypeText Text:=" Sona Git"
 ‘-------Cümlenin Başından sonuna işaretleme Kalın ve alt çizgili yap
   Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.Font.Bold = wdToggle
    Selection.Font.UnderlineColor = wdColorAutomatic
    Selection.Font.Underline = wdUnderlineSingle
‘-------Cümlenin Başından sonuna işaretleme Kalın ve alt çizgi kaldırma
    Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
    Selection.Font.Bold = wdToggle
    If Selection.Font.Underline = wdUnderlineNone Then
        Selection.Font.Underline = wdUnderlineSingle
    Else
        Selection.Font.Underline = wdUnderlineNone
    End If
    Selection.MoveRight Unit:=wdCharacter, Count:=1
‘------------- Seçimi kalın ve alt çizgili yapar ve iptal eder  
    Selection.Font.Bold = wdToggle
    Selection.Font.UnderlineColor = wdColorAutomatic
    Selection.Font.Underline = wdUnderlineSingle
    Selection.Font.UnderlineColor = wdColorAutomatic
    Selection.Font.Underline = wdUnderlineNone
    Selection.Font.Bold = wdToggle
‘-----------Mosue ile Seçimi kalın ve alt çizgili yapar ve iptal eder  
Selection.Font.Bold = wdToggle
    Selection.Font.UnderlineColor = wdColorAutomatic
    Selection.Font.Underline = wdUnderlineSingle
    Selection.Font.Bold = wdToggle
    Selection.Font.UnderlineColor = wdColorAutomatic
    Selection.Font.Underline = wdUnderlineNone
‘-------------------- İşaretleyerek seçim 
Selection.MoveRight Unit:=wdCharacter, Count:=28, Extend:=wdExtend
    Selection.Font.Bold = wdToggle
    Selection.Font.UnderlineColor = wdColorAutomatic
    Selection.Font.Underline = wdUnderlineSingle
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.Font.Bold = wdToggle
    Selection.Font.UnderlineColor = wdColorAutomatic
    Selection.Font.Underline = wdUnderlineNone
‘-----------Seçilen yere Hafızadakini yapıştırma
Selection.PasteAndFormat (wdFormatOriginalFormatting)
‘-----------Seçilen yere Yazı yazdırma
Selection.TypeText Text:="Eklenecek Metin"
‘-------  yazıyı Ayarları  ----------------
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter ‘------ Yazıyı ortala
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft   ‘------ Sola Yasla
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight‘------ Sağa Yasla
Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify ‘------- 2 yana yasla 
 ‘----------------Metnin başına tab ekleme 
Selection.TypeText Text:=vbTab
‘------------------ İlk Karakteri seçip silme
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
 Selection.Delete Unit:=wdCharacter, Count:=1
‘------------------ İlk 3 karakteri seçip silme
Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
‘-------- İlk Üç Cümleyi seç Kalın ve altı çizgili yap ------
Selection.MoveRight Unit:=wdWord, Count:=3, Extend:=wdExtend
Selection.Font.Bold = wdToggle
    If Selection.Font.Underline = wdUnderlineNone Then
        Selection.Font.Underline = wdUnderlineSingle
    Else
        Selection.Font.
Underline = wdUnderlineNone
    End If
‘-------- İlk Üç Cümlenin sonuna 2 tab ve 2 nokta üstüste ekle sonra  seç Kalın ve altı çizgili yap sonra kalın ve altı çizgiyi iptal et ------
Selection.MoveRight Unit:=wdWord, Count:=3
    Selection.TypeText Text:=vbTab & vbTab & ":" ’sonuna tab ve : ekle 
    Selection.MoveLeft Unit:=wdCharacter, Count:=38, Extend:=wdExtend
    If Selection.Font.Underline = wdUnderlineNone Then
        Selection.Font.Underline = wdUnderlineSingle
    Else
        Selection.Font.Underline = wdUnderlineNone
    End If
    Selection.Font.Bold = wdToggle
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.Font.Bold = wdToggle
    If Selection.Font.Underline = wdUnderlineNone Then
        Selection.Font.Underline = wdUnderlineSingle
    Else
        Selection.Font.Underline = wdUnderlineNone
    End If
‘-------- Cümlenin sonun git kelime ekle------
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:="Eklenecek Metin"
‘-------- Cümlenin sonun git Kalın ve altı çizgiyi iptal et kelime ekle------
Selection.EndKey Unit:=wdLine
Selection.Font.Bold = wdToggle
    If Selection.Font.Underline = wdUnderlineNone Then
        Selection.Font.Underline = wdUnderlineSingle
    Else
        Selection.Font.Underline = wdUnderlineNone
    End If
    Selection.TypeText Text:="Eklenecek Metin"
‘-------- Sayfa Kenar Ayarlarını (Çetveli Ayarlama ------
   Selection.PageSetup.LeftMargin = CentimetersToPoints(2.25)
    Selection.PageSetup.LeftMargin = CentimetersToPoints(2)
    Selection.PageSetup.LeftMargin = CentimetersToPoints(1.75)
    Selection.PageSetup.LeftMargin = CentimetersToPoints(1.5)
    Selection.PageSetup.LeftMargin = CentimetersToPoints(1.25)
    Selection.PageSetup.LeftMargin = CentimetersToPoints(1)
    Selection.PageSetup.LeftMargin = CentimetersToPoints(1)
    Selection.PageSetup.RightMargin = CentimetersToPoints(2.5)
    Selection.PageSetup.RightMargin = CentimetersToPoints(2.25)
    Selection.PageSetup.RightMargin = CentimetersToPoints(2)
    Selection.PageSetup.RightMargin = CentimetersToPoints(1.75)
    Selection.PageSetup.RightMargin = CentimetersToPoints(1.5)
    Selection.PageSetup.RightMargin = CentimetersToPoints(1.25)
    Selection.PageSetup.RightMargin = CentimetersToPoints(1)
    Selection.PageSetup.RightMargin = CentimetersToPoints(0.75)
    Selection.PageSetup.RightMargin = CentimetersToPoints(0.75)
    Selection.PageSetup.TopMargin = CentimetersToPoints(2.25)
    Selection.PageSetup.TopMargin = CentimetersToPoints(2)
    Selection.PageSetup.TopMargin = CentimetersToPoints(2)
    Selection.PageSetup.TopMargin = CentimetersToPoints(1.75)
    Selection.PageSetup.TopMargin = CentimetersToPoints(1.5)
    Selection.PageSetup.TopMargin = CentimetersToPoints(1.5)
    ActiveWindow.ActivePane.VerticalPercentScrolled = -167
    Selection.PageSetup.BottomMargin = CentimetersToPoints(2.25)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(2)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(2)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1.75)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1.5)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1.25)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1.5)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1.25)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1)
    Selection.PageSetup.BottomMargin = CentimetersToPoints(1)
‘-------- 1.5 inç Sayfa Kenar Çizgisi Ekleme ------
       With Selection.Sections(1)
        With .Borders(wdBorderLeft)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth150pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderRight)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth150pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderTop)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth150pt
            .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderBottom)
            .LineStyle = wdLineStyleSingle
            .LineWidth = wdLineWidth150pt
            .Color = wdColorAutomatic
        End With
        With .Borders
            .DistanceFrom = wdBorderDistanceFromPageEdge
            .AlwaysInFront = True
            .SurroundHeader = True
            .SurroundFooter = True
            .JoinBorders = False
            .DistanceFromTop = 24
            .DistanceFromLeft = 24
            .DistanceFromBottom = 24
            .DistanceFromRight = 24
            .Shadow = False
            .EnableFirstPageInSection = True
            .EnableOtherPagesInSection = True
            .ApplyPageBordersToAllSections
        End With
    End With
    With Options
        .DefaultBorderLineStyle = wdLineStyleSingle
        .DefaultBorderLineWidth = wdLineWidth150pt
        .DefaultBorderColor = wdColorAutomatic
    End With
‘-------- 1.5 inç Sayfa Kenar Çizgisi silme_kaldırma ------
With Selection.Sections(1)
        .Borders(wdBorderLeft).LineStyle = wdLineStyleNone
        .Borders(wdBorderRight).LineStyle = wdLineStyleNone
        .Borders(wdBorderTop).LineStyle = wdLineStyleNone
        .Borders(wdBorderBottom).LineStyle = wdLineStyleNone
        With .Borders
            .DistanceFrom = wdBorderDistanceFromPageEdge
            .AlwaysInFront = True
            .SurroundHeader = True
            .SurroundFooter = True
            .JoinBorders = False
            .DistanceFromTop = 24
            .DistanceFromLeft = 24
            .DistanceFromBottom = 24
            .DistanceFromRight = 24
            .Shadow = False
            .EnableFirstPageInSection = True
            .EnableOtherPagesInSection = True
            .ApplyPageBordersToAllSections
        End With
    End With
    With Options
        .DefaultBorderLineStyle = wdLineStyleSingle
        .DefaultBorderLineWidth = wdLineWidth150pt
        .DefaultBorderColor = wdColorAutomatic
    End With
‘-------- 6 Karakteri İşaretleyip Renk Değiştirme ------
‘---- Unit:=wdWord, Count:=2 (2) Cümle
‘---- Unit:=wdCharacter, Count:=6 (6) harf


Selection.MoveRight Unit:=wdCharacter, Count:=6, Extend:=wdExtend
    Selection.MoveRight Unit:=wdCharacter, Count:=1
‘-------- 6 Karakteri İşaretleyip Büyük Harfe Çevirme ------
    Selection.MoveRight Unit:=wdCharacter, Count:=6, Extend:=wdExtend
    Selection.Range.Case = wdUpperCase
    Selection.MoveRight Unit:=wdCharacter, Count:=1
‘-------- 2 Cümleyi İşaretleyip Küçük Harfe Çevirme ------
    Selection.MoveRight Unit:=wdWord, Count:=2, Extend:=wdExtend
    Selection.Range.Case = wdLowerCase
    Selection.MoveRight Unit:=wdCharacter, Count:=1
‘-------- 2 Cümleyi İşaretleyip Başharfleri Büyük Yapma Harfe Çevirme ------
    Selection.MoveRight Unit:=wdWord, Count:=2, Extend:=wdExtend
    Selection.Range.Case = wdTitleWord
    Selection.MoveRight Unit:=wdCharacter, Count:=1
Son Düzenleme: 03/08/2018, 02:48, Düzenleyen: bibib.
Cevapla
#2
Konunuzu Access dersleri bölümüne taşıyorum. Paylaşımınız için teşekkürler.
Cevapla
#3
Hocam siz değerli hocalarım ve sitede bulunan arkadaşların paylaşımları sayesinde edinmeye çalıştığımız bilgilerin yanında su damlası gibi hepinizden Allah razı olsun
Değişimde gelişimde beyinlerin değişmesi ve gelişmesi ile olur. By Bibib
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da