home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1995 October / PCPRO_OCT.ISO / code / win / code_2.txt < prev    next >
Encoding:
Text File  |  1995-08-08  |  677 b   |  25 lines

  1. Sub twosections()
  2. Dim newBinder As Object
  3. Set newBinder = CreateObject("Office.Binder")
  4. newBinder.Visible = True
  5. newBinder.Sections.Add Type:="Excel.Sheet"
  6. newBinder.Sections.Add Type:="Word.Document"
  7. newBinder.Sections(1).Activate
  8.  
  9. With newBinder.Sections(1)
  10.     ActiveCell.FormulaR1C1 = "123"
  11.     Range("A2").Select
  12.     ActiveCell.FormulaR1C1 = "234"
  13.     Range("A3").Select
  14.     ActiveCell.FormulaR1C1 = "345"
  15.     Range("A4").Select
  16.     ActiveCell.FormulaR1C1 = "456"
  17.     Range("A1").Select
  18. End With
  19.  
  20. newBinder.Sections(2).Activate
  21. With newBinder.Sections(2).Object.Application.WordBasic
  22.     .Insert "Hello, this is some text in Word"
  23. End With
  24. End Sub
  25.