J
John Edward
Hi,
I am trying to write a macro to remove the blank lines,
ie return key, of a document until the end of the
document. How do I check for the end of the document and
stop the macro with the while loop?
Here is my current code:
loopct = 0
Do While loopct < 5000
If Selection.Characters(1) Like Chr(13) Then
Selection.Delete Unit:=wdCharacter, Count:=1
Else
Selection.MoveDown Unit:=wdLine, Count:=1
End If
loopct = loopct + 1
Loop
Thanks in advance
I am trying to write a macro to remove the blank lines,
ie return key, of a document until the end of the
document. How do I check for the end of the document and
stop the macro with the while loop?
Here is my current code:
loopct = 0
Do While loopct < 5000
If Selection.Characters(1) Like Chr(13) Then
Selection.Delete Unit:=wdCharacter, Count:=1
Else
Selection.MoveDown Unit:=wdLine, Count:=1
End If
loopct = loopct + 1
Loop
Thanks in advance