Article ID: 153305
Article Last Modified on 1/25/2005
Option Explicit
Private Sub Command1_Click()
Dim objBinder As Object
Dim objWord As Object
Set objBinder = CreateObject("Office.Binder")
objBinder.Visible = True
Set objWord = CreateObject("Word.Basic")
With objWord
.FileNewDefault
.FormatStyle Name:="Heading 1", Apply:=True
.Insert "OLE Automation to Office Binder"
.InsertPara
.FileSaveAs "c:\ole_test.DOC"
.FileClose
End With
Set objWord = Nothing
With objBinder
.Sections.Add filename:="c:\ole_test.doc"
.Sections(1).Name = "Ole Sample from VB"
.SaveAs filename:="c:\vbNewBinder.obd", _
saveOption:=bindOverwriteExisting
.Visible = False
End With
Set objBinder = Nothing
End Sub
118817 Summary of Sample Applications on the ODK 1.0
108043 INFO: How VB Uses OLE Automation with Word Version 6.0
121736 Getting OLE Automation Methods/Properties Supported by OLE App
Keywords: kbhowto kb32bitonly kbprogramming KB153305