#1
|
|||
|
|||
reverse order of paragraphs, word 2010
I've been trying to do something that i supposed to be very simple, that is, simply to reverse the order of paragraphs in a very long (150,000 line) .rtf document. If I selesct number/descending in home/paragraph/sort, I end up with what looks to be random garbage; in the sample below, line order (note, not the numbers themselves) that started 1,2,3,4,5,6,7,8,9,10, 11 becomes line order 3,4,2,5,6,7,8,9,10,11,1:
1. A yeah, I damaged mine while reversing... Felt like a right idiot ¬ ¬ Jan 11, 2015 3:28pm 2. B I expect I’ll wreck it! ¬ ¬ Jan 11, 2015 12:06pm 3. B That’s not going to happen today ¬ ¬ Jan 11, 2015 12:05pm 4. A Just thought, if you’re not setting out too early, can you drop in before you set off? ¬ ¬ Jan 11, 2015 9:38am 5. A bye! ¬ ¬ Jan 11, 2015 8:35am 6. A yes, go to work! ¬ ¬ Jan 11, 2015 8:35am 7. B Gotta go to work!¬ ¬ Jan 11, 2015 8:35am 8. A thats a bit over the top! ¬ ¬ Jan 11, 2015 8:35am 9. A blimey! ¬ ¬ Jan 11, 2015 8:35am 10. B I bought the one with all the options! ¬ ¬ Jan 11, 2015 8:35am 11. A Did you get the cheap one in the end? ¬ ¬ Jan 11, 2015 8:35am becomes 1. A Did you get the cheap one in the end? ¬ ¬ Jan 11, 2015 8:35am 2. B That’s not going to happen today ¬ ¬ Jan 11, 2015 12:05pm 3. A yeah, I damaged mine while reversing... Felt like a right idiot ¬ ¬ Jan 11, 2015 3:28pm 4. B I expect I’ll wreck it! ¬ ¬ Jan 11, 2015 12:06pm 5. A Just thought, if you’re not setting out too early, can you drop in before you set off? ¬ ¬ Jan 11, 2015 9:38am 6. A bye! ¬ ¬ Jan 11, 2015 8:35am 7. A yes, go to work! ¬ ¬ Jan 11, 2015 8:35am 8. B Gotta go to work!¬ ¬ Jan 11, 2015 8:35am 9. A thats a bit over the top! ¬ ¬ Jan 11, 2015 8:35am 10. A blimey! ¬ ¬ Jan 11, 2015 8:35am 11. B I bought the one with all the options! ¬ ¬ Jan 11, 2015 8:35am obviously, waht I wanted was line order, 11,10,9,8,7,6,5,4,3,2,1 Will I need a macro to acheive this? If so, is there one 'pinned' somewheere on this forum that does this? It seems like such a simple thing |
#2
|
||||
|
||||
Sorting paragraphs can be rather hit and miss, but a macro will do it e.g.
Code:
Sub Macro1() Dim oSource As Document Dim oDoc As Document Dim lngPara As Long Dim oRng As Range Set oSource = ActiveDocument oSource.Save Set oDoc = Documents.Add(oSource.FullName) oDoc.Range.Text = "" For lngPara = oSource.Paragraphs.Count To 1 Step -1 Set oRng = oDoc.Range oRng.Collapse 0 oRng.FormattedText = oSource.Paragraphs(lngPara).Range.FormattedText Next lngPara lbl_Exit: Set oDoc = Nothing Set oSource = Nothing Set oRng = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
paragraphs, reverse |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
open dialog box in Word has folders in reverse alphabetical order | Rewster | Word | 2 | 02-20-2017 08:06 AM |
Is There an Animation that Will Reverse the Order of a Bulleted List | equity | PowerPoint | 3 | 04-04-2014 12:33 AM |
Reverse Order for Flashcards? | bknollman3 | PowerPoint | 2 | 03-23-2013 06:34 AM |
wildcards in find & replace to reverse word order | jeffk | Word | 3 | 11-11-2012 01:47 PM |
Reverse order of headings throughout Word | my_vine_figtree | Word VBA | 1 | 08-17-2010 01:46 AM |