Sub
DokumentEinlesen()
Dim
strLine
As
String
Dim
colString
As
Collection
Dim
intLastLine
As
Integer
Dim
intLastPage
As
Integer
Dim
flag
As
Boolean
Selection.EndKey unit:=wdStory
intLastLine = _
Selection.Range.Information(wdFirstCharacterLineNumber)
intLastPage = _
Selection.Range.Information(wdActiveEndPageNumber)
Set
colString =
New
Collection
Selection.HomeKey unit:=wdStory
flag =
True
While
flag =
True
If
(Selection.Range.Information(wdFirstCharacterLineNumber) = intLastLine)
And
intLastPage = _
Selection.Range.Information(wdActiveEndPageNumber)
Then
flag =
False
End
If
Selection.EndKey unit:=wdLine, Extend:=wdExtend
strLine = Selection.Range.Text
colString.Add (strLine)
Selection.MoveDown unit:=wdLine, Count:=1
Selection.HomeKey unit:=wdLine
Wend
End
Sub
Ich bin noch ein ziemlicher Anfänger, wenn es um VBA geht.
Mit freundlichen Grüßen
Mike