Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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
Posted to microsoft.public.word.newusers
|
|||
|
|||
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. |
#6
Posted to microsoft.public.word.newusers
|
|||
|
|||
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. |
#7
Posted to microsoft.public.word.newusers
|
|||
|
|||
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 |
#8
Posted to microsoft.public.word.newusers
|
|||
|
|||
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. |
#9
Posted to microsoft.public.word.newusers
|
|||
|
|||
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. |
#10
Posted to microsoft.public.word.newusers
|
|||
|
|||
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? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
index | Microsoft Word Help | |||
Index Not working right? | Microsoft Word Help | |||
Creating an index: need a template of a concordance file | Tables | |||
Updating Index renumbers pages in the body of the document | Microsoft Word Help | |||
Problem with Page Numbers in Index using Word 2002 | Microsoft Word Help |