Importing Word text into Excel
I need to import a number of text lines from Word file into Excel. Using what
I found from postings here on importing tables and the Word macro recorder I
have the following partial code:
FName = Application _
.GetOpenFilename("Word Files (*.doc), *.doc")
Set oWord = GetObject(FName)
With oWord.Find
.Text = "Seq."
.Replacement.Text = ""
....
End With 'oWord
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=66, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=100, Extend:=wdExtend
Selection.Copy
Cells("A1").Activate
ActiveSheet.Paste
However, Excel VBA doesn't know wdCharacter or wdLine. It doesn't know
wdForward if I try a Move function. The number of lines of text to import is
constant.
Any workarounds would be greatly appreciated!
|