I am able to write to Word Document from a VBA macro, but I am having trouble with syntax to generate headers, paragraphs, tables etc...
This example writes two lines to a Word Document, but both come out as header style. I would like one line header and one line in paragraph or "normal" style...
Dim wdApp As Word.Application
Set wdApp = New Word.Application
With wdApp
.Visible = True
.Activate
.Documents.Add
With .Selection
.Style = "Heading 1"
.TypeText ("My Heading")
.TypeParagraph
.Style = "Normal"
.TypeText ("Some regular paragraph text")
End With
Heading 1
style for first row andNormal
style for second: i.stack.imgur.com/TvFZL.png - Dmitry Pavliv