~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Command1_Click()
Dim oApp As Word.Application
Dim oWord As Word.Document
Set oApp = _
CreateObject("Word.Application")
Set oWord = _
oApp.Documents.Open( _
FileName:="{file path}\aboutacw.doc")
oApp.Visible = True
~~~~~~~~~~~~~~~~~~~~~~~~~
Unlike the previous Word examples, in this one, the entire Word application opens and the document is visible using the statement:
~~~~~~~~~~~~~~~~~~~~~~~~~
oApp.Visible = True
~~~~~~~~~~~~~~~~~~~~~~~~~
By sizing the Word window and single stepping through the VBA code in Excel, you can see the effect of the next statements while you run the program. Here's the code to copy the lines of the verse into rows in the Access database:
~~~~~~~~~~~~~~~~~~~~~~~~~
oApp.Selection.HomeKey _
Unit:=wdStory
oApp.Selection.EndKey _
Unit:=wdLine, Extend:=wdExtend
DoCmd.GoToRecord , , acNewRec
Do Until oApp.Selection.End + 1 >= _
oApp.ActiveDocument.Content.StoryLength
Me.AboutText = oApp.Selection.Text
DoCmd.GoToRecord , , acNewRec
oApp.Selection.MoveDown Unit:=wdLine, _
Count:=1
oApp.Selection.HomeKey _
Unit:=wdLine
oApp.Selection.EndKey _
Unit:=wdLine, Extend:=wdExtend
Loop
Exit_WordDoc:
Me.AboutText = oApp.Selection.Text
DoCmd.GoToRecord , , acNewRec
~~~~~~~~~~~~~~~~~~~~~~~~~

