|
-
Oct 11th, 2000, 12:42 AM
#1
Thread Starter
New Member
Below is some code writen for the purpose of learning more about Word VBA. This code eliminates consecutive identical paragraphs -- but it is ugly code. How can I cut this down, by identifying the two paragraphs in the If statement? Please help. Thanks.
Sub Macro1()
Selection.HomeKey Unit:=wdStory
For i = 1 To ActiveDocument.Paragraphs.Count - 1
Selection.Paragraphs(1).Range.Select
Nextpara = Selection.Paragraphs(1).Next
If Selection = Nextpara Then
'Why can't this line incorporate the above two lines? Help!
Selection.Delete
Else
Selection.MoveDown Unit:=wdParagraph
End If
Next i
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|