W
WT
I have the following code and it works but unfortunately it won't do the
entire document because I don't know how to recognize the end of the file. I
have looked at the reference manuals but most only discuss how to modify the
last paragraph not how to determine when you get there and set an end to the
loop.
Please enlighten me ......
Dim rngParagraphs As Range, ststr(6), x, y
y = 100
x = 1
Do
'For x = x To y
Selection.HomeKey Unit:=wdLine
With ActiveDocument.Paragraphs(x).Range
.Select
End With
If (IsNumeric(Mid(ActiveDocument.Paragraphs(x).Range, 1, 1))) Then
x = x + 1
Else
With ActiveDocument.Paragraphs(x).Range
.Select
.Cut
.Collapse Direction:=wdCollapseEnd
End With
End If
'Next
Loop Until "eof ?????"
entire document because I don't know how to recognize the end of the file. I
have looked at the reference manuals but most only discuss how to modify the
last paragraph not how to determine when you get there and set an end to the
loop.
Please enlighten me ......
Dim rngParagraphs As Range, ststr(6), x, y
y = 100
x = 1
Do
'For x = x To y
Selection.HomeKey Unit:=wdLine
With ActiveDocument.Paragraphs(x).Range
.Select
End With
If (IsNumeric(Mid(ActiveDocument.Paragraphs(x).Range, 1, 1))) Then
x = x + 1
Else
With ActiveDocument.Paragraphs(x).Range
.Select
.Cut
.Collapse Direction:=wdCollapseEnd
End With
End If
'Next
Loop Until "eof ?????"