From the Office Automation Help file:
Create a Word Document
The following code creates a document and records its creation date.
Sub createDoc()
Dim wordApp As Word.Application
Dim wordDoc As Word.Document
Dim wordRng As Word.Range
Dim wordPara As Word.Paragraph
Set wordApp = CreateObject("Word.Application"
With WordApp
.WindowState = wdWindowStateMaximize
.Documents.Add
Set wordDoc = wordApp.ActiveDocument
Set wordRng = wordDoc.Range
With wordRng
.Font.Bold = True
.Font.Italic = True
.Font.Size = 16
.InsertAfter "Running Word Using Automation"
.InsertParagraphAfter
' insert a blank paragraph between the two paragraphs
.InsertParagraphAfter
End With
Set wordPara = wordRng.Paragraphs(3)
With wordPara.Range
.Bold = True
.Italic = False
.Font.Size = 12
.InsertAfter "Report Created: "
.Collapse Direction:=wdCollapseEnd
.InsertDateTime DateTimeFormat:="MM-DD-YY HH:MM:SS"
End With
.ActiveDocument.SaveAs "c:\My Documents\createDoc.Doc"
.Quit
End With
Set wordPara = Nothing
Set wordRng = Nothing
Set wordDoc = Nothing
Set wordApp = Nothing
End Sub