Skip to main content

AccessTr.neT


Vba Kod İle Word Dosyası Oluşturmak

Vba Kod İle Word Dosyası Oluşturmak

#1
Vba Kod İle Word Dosyası Oluşturmak için
Dim objWord As Word.Application
Dim doc As Word.Document
Dim WordHeaderFooter As HeaderFooter

Set objWord = CreateObject("Word.Application")

With objWord
    .Visible = True

    Set doc = .Documents.Add
    doc.SaveAs CurrentProject.Path & "\TestDoc.doc"
End With

With objWord.Selection

.Font.Name = "Trebuchet MS"
.Font.Size = 16

  .TypeText "Here is an example test line, #" & " - Font size is " & .Font.Size
  .TypeParagraph

    'Add header and footer

    ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = "Header"
    ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = "Footer"
End With

doc.Save
doc.Activate
@benbendedeilem
Cevapla

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

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Vba Kod İle Word Dosyası Oluşturmak - Yazar: accessman - 31/05/2020, 12:08
Task