![]() |
|
#1
|
|||
|
|||
|
I'd like to find the longest paragraph in the currently active Word document. Perhaps someone here can give me suggestions for VBA code.
I want to be able to activate a macro that finds and then selects the longest paragraph in the document. Even better, activating a second time causes the macro change the selection to the second longest paragraph and so on. My current thoughts are to create a 2 x n array that is populated with the paragraph numbers and the corresponding word counts, sort the array by word counts, and then set the active selection to corresponding paragraph number. But I don't know how to implement this and perhaps there's a better way to get to the same solution. Thanks! |
| Tags |
| paragraph, sort, vba |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find several words in document, copy paragraph and create new document
|
coolio2341 | Word VBA | 6 | 01-31-2019 01:17 PM |
Find word, Insert Paragraph and bookmark
|
gattaca714 | Word VBA | 2 | 03-24-2017 09:23 PM |
| Find Word then Highlight Whole Sentence and Paragraph Around it | ChrisOK | Word VBA | 4 | 09-08-2016 10:16 PM |
| Arrange shortest to longest sentence in Word | omar | Word | 8 | 11-20-2015 04:38 PM |
| Find last word in paragraph and delete it | Dave T | Word VBA | 3 | 05-21-2015 12:40 AM |