Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Paul MR
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

Word 2002 (10.4524.4219) SP-2
From my document I am trying to make an index of song titles. But when
I generate, the alphabetical order keeps getting screwed up by the
apostrophes like this:

I WANNA BE LOVED BY YOU, 30
IF YOU KNEW SUSIE, 34
I'LL GET BY, 31
I'LL NEVER FALL IN LOVE AGAIN, 31
I'LL NEVER SMILE AGAIN, 31
I'M BEGINNING TO SEE THE LIGHT, 31
IT HAD TO BE YOU, 36
IT'S ONLY A PAPER MOON, 33
I'VE GOT YOU UNDER MY SKIN, 32
I'VE GROWN ACCUSTOMED TO HER FACE, 32

How can I fix this?

Paul in San Francisco
  #2   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

If you sort text alpha-numerically then ' comes before a, so you will get
the sort order you showed. If you use the replace funtion to replace ' with
^0146, ^0146 (smart quote) comes after Z so you can sort to produce


I WANNA BE LOVED BY YOU, 30

I'LL GET BY, 31

I'LL NEVER FALL IN LOVE AGAIN, 31

I'LL NEVER SMILE AGAIN, 31

I'M BEGINNING TO SEE THE LIGHT, 31

I'VE GOT YOU UNDER MY SKIN, 32

I'VE GROWN ACCUSTOMED TO HER FACE, 32

IF YOU KNEW SUSIE, 34

IT HAD TO BE YOU, 36

IT'S ONLY A PAPER MOON, 33


If you want you can then replace ^0146 with '

The following macro will do all that to a selected block of titles.
http://www.gmayor.com/installing_macro.htm

Sub SongSort()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "'"
.Replacement.Text = "^0146"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Sort , FieldNumber:="Paragraphs", _
SortFieldType:=wdSortFieldAlphanumeric, _
SortOrder:=wdSortOrderAscending
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^0146"
.Replacement.Text = "'"
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org

Paul MR wrote:
Word 2002 (10.4524.4219) SP-2
From my document I am trying to make an index of song titles. But
when I generate, the alphabetical order keeps getting screwed up by
the apostrophes like this:

I WANNA BE LOVED BY YOU, 30
IF YOU KNEW SUSIE, 34
I'LL GET BY, 31
I'LL NEVER FALL IN LOVE AGAIN, 31
I'LL NEVER SMILE AGAIN, 31
I'M BEGINNING TO SEE THE LIGHT, 31
IT HAD TO BE YOU, 36
IT'S ONLY A PAPER MOON, 33
I'VE GOT YOU UNDER MY SKIN, 32
I'VE GROWN ACCUSTOMED TO HER FACE, 32

How can I fix this?

Paul in San Francisco



  #3   Report Post  
Posted to microsoft.public.word.newusers
Paul MR
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

Thanks, Graham. But I'm not sure I understand your analysis.

First, it seems as though the index function alphabetized by completely
ignoring the '. It clearly did not sort the ' before a.

Secondly, if I understand your suggestion, I am first supposed to
generate an index which will be sorted incorrectly. Then I am to block
select the incorrect index (which will run to several pages) and then I
am to apply the find and replace macro you kindly provided. I will have
to go through this process after each draft of the document that might
add anything to the index or change the page number where the index
target is located. Is my understanding correct?
Paul in San Francisco

Graham Mayor wrote:
If you sort text alpha-numerically then ' comes before a, so you will get
the sort order you showed. If you use the replace funtion to replace ' with
^0146, ^0146 (smart quote) comes after Z so you can sort to produce


I WANNA BE LOVED BY YOU, 30

I'LL GET BY, 31

I'LL NEVER FALL IN LOVE AGAIN, 31

I'LL NEVER SMILE AGAIN, 31

I'M BEGINNING TO SEE THE LIGHT, 31

I'VE GOT YOU UNDER MY SKIN, 32

I'VE GROWN ACCUSTOMED TO HER FACE, 32

IF YOU KNEW SUSIE, 34

IT HAD TO BE YOU, 36

IT'S ONLY A PAPER MOON, 33


If you want you can then replace ^0146 with '

The following macro will do all that to a selected block of titles.
http://www.gmayor.com/installing_macro.htm

Sub SongSort()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "'"
.Replacement.Text = "^0146"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Sort , FieldNumber:="Paragraphs", _
SortFieldType:=wdSortFieldAlphanumeric, _
SortOrder:=wdSortOrderAscending
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^0146"
.Replacement.Text = "'"
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub


  #4   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

The sort function when used to sort text does not ignore the apostrophe. It
treats it as an alphanumeric character and produces the list you originally
quoted. You can change all the apostrophes in your document to a single
smart quote (automatically if you like, using the autoformat as you type -
convert straight quotes to smart quotes) and the problem will go away. The
macro is only required if you want to retain a straight quote for the
apsotrophe. Using smart quotes for apostrophes produces the list that I
quoted.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Paul MR wrote:
Thanks, Graham. But I'm not sure I understand your analysis.

First, it seems as though the index function alphabetized by
completely ignoring the '. It clearly did not sort the ' before a.

Secondly, if I understand your suggestion, I am first supposed to
generate an index which will be sorted incorrectly. Then I am to
block select the incorrect index (which will run to several pages)
and then I am to apply the find and replace macro you kindly
provided. I will have to go through this process after each draft of
the document that might add anything to the index or change the page
number where the index target is located. Is my understanding correct?
Paul in San Francisco

Graham Mayor wrote:
If you sort text alpha-numerically then ' comes before a, so you
will get the sort order you showed. If you use the replace function
to replace ' with ^0146, ^0146 (smart quote) comes after Z so you
can sort to produce I WANNA BE LOVED BY YOU, 30

I'LL GET BY, 31

I'LL NEVER FALL IN LOVE AGAIN, 31

I'LL NEVER SMILE AGAIN, 31

I'M BEGINNING TO SEE THE LIGHT, 31

I'VE GOT YOU UNDER MY SKIN, 32

I'VE GROWN ACCUSTOMED TO HER FACE, 32

IF YOU KNEW SUSIE, 34

IT HAD TO BE YOU, 36

IT'S ONLY A PAPER MOON, 33


If you want you can then replace ^0146 with '

The following macro will do all that to a selected block of titles.
http://www.gmayor.com/installing_macro.htm

Sub SongSort()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "'"
.Replacement.Text = "^0146"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Sort , FieldNumber:="Paragraphs", _
SortFieldType:=wdSortFieldAlphanumeric, _
SortOrder:=wdSortOrderAscending
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^0146"
.Replacement.Text = "'"
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub



  #5   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

Interesting. I wouldn't have thought straight vs. smart would make this
difference. That explains why (*with* smart quotes) I'm sometimes not seeing
the sort results I expect.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Graham Mayor" wrote in message
...
If you sort text alpha-numerically then ' comes before a, so you will get
the sort order you showed. If you use the replace funtion to replace '

with
^0146, ^0146 (smart quote) comes after Z so you can sort to produce


I WANNA BE LOVED BY YOU, 30

I'LL GET BY, 31

I'LL NEVER FALL IN LOVE AGAIN, 31

I'LL NEVER SMILE AGAIN, 31

I'M BEGINNING TO SEE THE LIGHT, 31

I'VE GOT YOU UNDER MY SKIN, 32

I'VE GROWN ACCUSTOMED TO HER FACE, 32

IF YOU KNEW SUSIE, 34

IT HAD TO BE YOU, 36

IT'S ONLY A PAPER MOON, 33


If you want you can then replace ^0146 with '

The following macro will do all that to a selected block of titles.
http://www.gmayor.com/installing_macro.htm

Sub SongSort()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "'"
.Replacement.Text = "^0146"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Sort , FieldNumber:="Paragraphs", _
SortFieldType:=wdSortFieldAlphanumeric, _
SortOrder:=wdSortOrderAscending
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^0146"
.Replacement.Text = "'"
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org

Paul MR wrote:
Word 2002 (10.4524.4219) SP-2
From my document I am trying to make an index of song titles. But
when I generate, the alphabetical order keeps getting screwed up by
the apostrophes like this:

I WANNA BE LOVED BY YOU, 30
IF YOU KNEW SUSIE, 34
I'LL GET BY, 31
I'LL NEVER FALL IN LOVE AGAIN, 31
I'LL NEVER SMILE AGAIN, 31
I'M BEGINNING TO SEE THE LIGHT, 31
IT HAD TO BE YOU, 36
IT'S ONLY A PAPER MOON, 33
I'VE GOT YOU UNDER MY SKIN, 32
I'VE GROWN ACCUSTOMED TO HER FACE, 32

How can I fix this?

Paul in San Francisco






  #6   Report Post  
Posted to microsoft.public.word.newusers
Paul MR
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

Graham: I am not using the sort function; I am using the index
function. PLEASE look again at my original post. Do you not agree that
if the straight apostrophe had indeed been indexed before A, then the
resulting list would have been in proper alphabetical order? At least
all the words beginning with "I' " should have been together in a group?
If we can agree on that, can we then agree that indexing a smart
apostrophe as a character after Z will result in an even more peculiar
list: "IT" would show up before "I'LL."
Paul

Graham Mayor wrote:
The sort function when used to sort text does not ignore the apostrophe. It
treats it as an alphanumeric character and produces the list you originally
quoted. You can change all the apostrophes in your document to a single
smart quote (automatically if you like, using the autoformat as you type -
convert straight quotes to smart quotes) and the problem will go away. The
macro is only required if you want to retain a straight quote for the
apsotrophe. Using smart quotes for apostrophes produces the list that I
quoted.

  #7   Report Post  
Posted to microsoft.public.word.newusers
Paul MR
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

So, Suzanne, did you ever succeed in obtaining the indexing results you
expect even though you use smart quotes? How?
Paul in San Francisco

Suzanne S. Barnhill wrote:
Interesting. I wouldn't have thought straight vs. smart would make this
difference. That explains why (*with* smart quotes) I'm sometimes not seeing
the sort results I expect.

  #8   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill
 
Posts: n/a
Default Alphabetizing index - apostrophe problem

I was referring to sorting in tables and paragraphs, not indexes. Does your
index sort correctly if you use smart quotes in the XE fields?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Paul MR" wrote in message
...
So, Suzanne, did you ever succeed in obtaining the indexing results you
expect even though you use smart quotes? How?
Paul in San Francisco

Suzanne S. Barnhill wrote:
Interesting. I wouldn't have thought straight vs. smart would make this
difference. That explains why (*with* smart quotes) I'm sometimes not

seeing
the sort results I expect.


  #9   Report Post  
Posted to microsoft.public.word.newusers
Paul MR
 
Posts: n/a
Default Solved Alphabetizing index - apostrophe problem

YES! Using smart quotes in the XE fields did work. Thank you. I'm glad
this got fixed before I proceeded too far in the document.

I had turned off smart quotes intentionally, because my text has many
words that begin with an apostrophe ('twas, 'tis, 'cause, etc.) and the
smart quotes were displaying the apostrophe upside down -- i.e. as an
opening single quotation mark. Now I have smart quotes turned back on
for the remainder of the document.

Paul in San Francisco

Suzanne S. Barnhill wrote:
I was referring to sorting in tables and paragraphs, not indexes. Does your
index sort correctly if you use smart quotes in the XE fields?

  #10   Report Post  
Posted to microsoft.public.word.newusers
Paul MR
 
Posts: n/a
Default Solved. Alphabetizing index - apostrophe problem

Problem solved. Copying a smart quote to each XE field did the trick.
Thank you so much for pointing in the right direction.
Paul in San Francisco

Graham Mayor wrote:
The sort function when used to sort text does not ignore the apostrophe. It
treats it as an alphanumeric character and produces the list you originally
quoted. You can change all the apostrophes in your document to a single
smart quote (automatically if you like, using the autoformat as you type -
convert straight quotes to smart quotes) and the problem will go away. The
macro is only required if you want to retain a straight quote for the
apsotrophe. Using smart quotes for apostrophes produces the list that I
quoted.



  #11   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill
 
Posts: n/a
Default Solved Alphabetizing index - apostrophe problem

You can force an apostrophe by pressing Ctrl+', ' (that is, press Ctrl and
the apostrophe key simultaneously, then press apostrophe again). This
technique can also be used to force opening or closing single or double
quotes as needed; see the shortcuts at
http://word.mvps.org/FAQs/General/InsertSpecChars.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Paul MR" wrote in message
...
YES! Using smart quotes in the XE fields did work. Thank you. I'm glad
this got fixed before I proceeded too far in the document.

I had turned off smart quotes intentionally, because my text has many
words that begin with an apostrophe ('twas, 'tis, 'cause, etc.) and the
smart quotes were displaying the apostrophe upside down -- i.e. as an
opening single quotation mark. Now I have smart quotes turned back on
for the remainder of the document.

Paul in San Francisco

Suzanne S. Barnhill wrote:
I was referring to sorting in tables and paragraphs, not indexes. Does

your
index sort correctly if you use smart quotes in the XE fields?


  #12   Report Post  
Posted to microsoft.public.word.newusers
Paul MR
 
Posts: n/a
Default Solved Alphabetizing index - apostrophe problem

Thanks again. As I make the transition from Word Perfect to Word, these
little tips and sources of information are very helpful.
Paul in San Francisco

Suzanne S. Barnhill wrote:
You can force an apostrophe by pressing Ctrl+', ' (that is, press Ctrl and
the apostrophe key simultaneously, then press apostrophe again). This
technique can also be used to force opening or closing single or double
quotes as needed; see the shortcuts at
http://word.mvps.org/FAQs/General/InsertSpecChars.htm

  #13   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill
 
Posts: n/a
Default Solved Alphabetizing index - apostrophe problem

In case no one else has pointed you to them (can't remember whether Charles
has already done so or not), these articles are helpful for those making the
transition from WordPerfect:

How Word differs from WordPerfect
http://word.mvps.org/FAQs/General/WordVsWordPerfect.htm

Some Tips and “Gotchas” for those who are new to Word
Especially if migrating from WordPerfect
http://word.mvps.org/FAQs/General/TipsAndGotchas.htm

Is There Life After “Reveal Codes”?
http://word.mvps.org/FAQs/General/RevealCodes.htm

WordPerfect to Word converters (and why none of them are perfect)
http://word.mvps.org/FAQs/General/Wo...Converters.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Paul MR" wrote in message
...
Thanks again. As I make the transition from Word Perfect to Word, these
little tips and sources of information are very helpful.
Paul in San Francisco

Suzanne S. Barnhill wrote:
You can force an apostrophe by pressing Ctrl+', ' (that is, press Ctrl

and
the apostrophe key simultaneously, then press apostrophe again). This
technique can also be used to force opening or closing single or double
quotes as needed; see the shortcuts at
http://word.mvps.org/FAQs/General/InsertSpecChars.htm


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
index Maurice Microsoft Word Help 3 January 13th 06 09:17 PM
Index Not working right? Ms_Chris Microsoft Word Help 0 December 20th 05 06:18 PM
Creating an index: need a template of a concordance file Dr Roben Tables 3 September 20th 05 05:20 AM
Updating Index renumbers pages in the body of the document banquomd Microsoft Word Help 1 August 19th 05 10:31 AM
Problem with Page Numbers in Index using Word 2002 jdkelley Microsoft Word Help 1 December 1st 04 03:32 PM


All times are GMT +1. The time now is 07:07 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"