Article ID: 142475
Article Last Modified on 10/11/2006
Public Function wordtest()
Dim w As Object
Set w = CreateObject("word.basic")
With w
.filenew template:="Normal"
.INSERT "This is a test."
.editselectall
.allcaps 1
.bold 1
.formatfont points:=14, underline:=1, font:="arial"
.filesaveas Name:="c:\examples\wordtest.doc"
End With
End Functionwordtest
Name: Command4
Caption: My Button
OnClick: [Event Procedure]
Private Sub Command4_Click()
Dim worddoc As Object
With MyOleField
.Class = "Word.Document"
.OLETypeAllowed = acOLEEmbedded
.Action = acOLECreateEmbed
.Verb = acOLEVerbInPlaceUIActivate
.Action = acOLEActivate
End With
Set worddoc = Me![myolefield].Object.Application.wordbasic
With worddoc
.INSERT "This is a test."
.editselectall
.allcaps 1
.bold 1
.formatfont points:=14, underline:=1, font:="arial"
End With
Command4.SetFocus
End Sub
Keywords: kbhowto kbprogramming KB142475