![]() |
#3
|
|||
|
|||
![]()
That was embarressingly simple.
CorelDraw uses ActiveSelectionRange. I tried a dozen variations of this without success. Thanks for the advice it's much appreciated. For anyone who comes across this thread in the future, below is the ammended version. I've also included a message box warning when the user forgets to select any text. Code:
Sub ReverseOrderOfParagraphs() Dim tmpTable As Table Dim rg As Range InSelection = False If Selection.Type = wdSelectionIP Then MsgBox "Nothing Selected" End End If Set tmpTable = Selection.Range.ConvertToTable(Separator:=wdSeparateByParagraphs) With tmpTable .Columns.Add BeforeColumn:=.Columns(1) Set rg = .Cell(1, 1).Range rg.End = rg.End - 1 rg.Fields.Add Range:=rg, Type:=wdFieldSequence, Text:="a" rg.Cells(1).Range.Copy .Columns(1).Select Selection.Paste Selection.Fields.Update .Sort ExcludeHeader:=False, FieldNumber:=1, SortOrder:=wdSortOrderDescending .Columns(1).Delete .ConvertToText End With End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How Do I Control Paragraph Spacing in a Numbered List | SteveClark590 | Word | 11 | 07-08-2021 07:31 PM |
How do I order the paragraph styles list? | Tunathedog | Word | 3 | 04-08-2016 05:37 AM |
![]() |
brent chadwick | Word VBA | 15 | 02-26-2016 05:25 PM |
![]() |
equity | PowerPoint | 3 | 04-04-2014 12:33 AM |
Macro to reverse a test string | Jennifer Murphy | Word VBA | 5 | 01-16-2014 03:19 PM |