Article ID: 154567
Article Last Modified on 10/11/2006
Function CreateDoc()
Dim ThisWord As Word95ACC.Word95Access
Set ThisWord = CreateObject("Word.Basic")
With ThisWord
.AppMaximize
' Create a new document based on the default template (usually
' Normal)
.FileNewDefault
.FormatFont _
Points:=22, _
Bold:=True, _
Italic:=True
.INSERT "Welcome to Word OLE Automation"
.InsertPara
.FormatFont _
Points:=10, _
Bold:=False, _
Italic:=False
.INSERT "Report Created:"
' Insert the date as text, not as an updateable field
.InsertDateTime _
DateTimePic:="YYYY MM DD HH:MM:SS", _
InsertAsField:=False
.InsertPara
End With
End Function
?CreateDoc()
Keywords: kbhowto kbinterop kbprogramming KB154567