home *** CD-ROM | disk | FTP | other *** search
- Sub twosections()
- Dim newBinder As Object
- Set newBinder = CreateObject("Office.Binder")
- newBinder.Visible = True
- newBinder.Sections.Add Type:="Excel.Sheet"
- newBinder.Sections.Add Type:="Word.Document"
- newBinder.Sections(1).Activate
-
- With newBinder.Sections(1)
- ActiveCell.FormulaR1C1 = "123"
- Range("A2").Select
- ActiveCell.FormulaR1C1 = "234"
- Range("A3").Select
- ActiveCell.FormulaR1C1 = "345"
- Range("A4").Select
- ActiveCell.FormulaR1C1 = "456"
- Range("A1").Select
- End With
-
- newBinder.Sections(2).Activate
- With newBinder.Sections(2).Object.Application.WordBasic
- .Insert "Hello, this is some text in Word"
- End With
- End Sub
-