Back to 11/96 How To: Power Windows
Up to Table of Contents
Ahead to 11/96 How To: Programming Windows

11/96 How To: Power Windows: So Happy Together

1. Sub RunWord()

2. Dim WordObj As Object
3.Set WordObj = CreateObject("Word.Basic")
4.WordObj.FileOpen "PWTEST.DOC"
5.WordObj.EndOfDocument
6.WordObj.Insert Sheets ("Sheet1").Range("A1").Text
7.WordObj.FilePrint 0

8. End Sub

This VBA subroutine allows Excel to control Word behind the scenes. (Line numbers added for clarification only.)

Back to 11/96 How To: Power Windows
Up to Table of Contents
Ahead to 11/96 How To: Programming Windows