View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default Sort without "the" or "a"

lilac,

Manually ;-)

AFAIK, you will have to convert "The ABC" to "ABC, The" and things like "A
Nation" to "Nation, A" before sorting.

You do it with a macro. Selecti your list paragraphs and run this code:

Sub ScratchMaco()
Dim oRng As Word.Range
Dim oPar As Paragraph
Dim oRngProcess
Dim pStr As String
Set oRng = Selection.Range
For Each oPar In oRng.Paragraphs
Select Case oPar.Range.Words.First
Case "The ", "A "
pStr = ", " & Trim(oPar.Range.Words.First)
oPar.Range.Words.First.Delete
Set oRngProcess = oPar.Range
oRngProcess.Collapse wdCollapseEnd
oRngProcess.MoveEnd wdCharacter, -1
oRngProcess.InsertAfter pStr
End Select
Next
Selection.Sort
End Sub

http://www.gmayor.com/installing_macro.htm

lilac wrote:
I want to sort a list of titles, but items such as "The ABC" should
be under A not T. How do I do this?


--
Greg Maxey

See my web site http://gregmaxey.mvps.org
for an eclectic collection of Word Tips.

Arrogance is a weed that grows mostly on a dunghill (Arabic proverb)