Written by Allen Wyatt (last updated February 5, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021
Barry has a document (for a thesis) with index entries (XE fields) of "Gen. 1:20", "Exo. 20:2", and "1 Thes. 4:14". When he generates the index, it comes out in alphabetical order (1 Thes. 4:14, Exo. 20:2, Gen. 1:20), but he wants it to be in biblical canonical order, i.e., Gen. 1:20, Exo. 20:2, 1 Thes. 4:14. Barry wonders if there is a way to change the collating sequence so that a document's index is not alphabetical.
The answer to this query is to use an esoteric (some say "undocumented") feature of Word that allows you to override how index entries are sorted. Consider the following index entry—a field—as created by Word:
{ XE "Exo. 20\:2" }
This entry was created by selecting the text "Exo. 20:2" (without the quote marks) and then marking it as an index entry. You can modify how Word sorts the index entry, however, by modifying the field code. Simply follow the entry with a semicolon and the way in which it should be sorted in the index, in this manner:
{ XE "Exo. 20\:2;02Exodus 20\:02" }
In this case I've assigned an arbitrary prefix of "02" before the book name (Exodus) to signify that this is the second book of the bible. I also modified the verse number from "2" to "02" so that any other index entries for the second chapter of Exodus will sort correctly in relation to each other.
I could also have gotten more cryptic with my index sorting code, in this manner:
{ XE "Exo. 20\:2;022002" }
In this case, the code means "book 02, chapter 20, verse 02." If I had actually wanted the scripture reference to be subordinate to a different entry, such as "Old Testament References," then the field code would need to be further expanded, in this manner:
{ XE "Exo. 20\:2;022002:Old Testament References" }
Note the treatment of the two colons in the field: The first one is "escaped out" by the inclusion of the backslash and the second one is not. The backslash is included so that Word understands the colon is not the demarcation between the entry and subentry portions of the field.
You can even go so far as to change the sorting entry of the subentry designation, using the same semicolon as you did in the main entry:
{ XE "Exo. 20\:2;022002:Old Testament References;Bible Verses 1" }
This example causes "Old Testament References" (which is what appears in the actual index) to be sorted as "Bible Verses 1". You could then, with New Testament References, use the sorting code of "Bible Verses 2", which means that they would appear after the Old Testament grouping, as they should.
With this sorting override trick under your belt, you could get creative with your index entries, but it will take a bit of work: every single index entry will need to be manually adjusted to include whatever pattern you want to use for your sorting. This can get tedious (as you might imagine), but you could make it easier by developing your own macros to do the field updating for you. Such a macro would depend on the sorting pattern you established and what you want, exactly, the macro to do. You really should, for example, have one that adds the sorting pattern you want and one that removes it.
You can find additional information about this approach to sorting index entries at the following websites:
https://buildabiblicalreferenceindexwithword.wordpress.com/ https://taxonomist.tripod.com/indexing/wordproblems.html#override
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (7545) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
When indexing a document, you may find that some of your index entries aren't formatted the same as your other index ...
Discover MorePutting together an index for your documents can be challenging, but Word provides some great tools to make the task ...
Discover MoreAfter you get your document ready for indexing by inserting index fields throughout it, you may want to index only a ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-02-07 09:15:15
Helen Playdon
Hooray, a Tip that I can not only understand but can see WHEN I might want to use it. Your choice of example was most apposite (my husband is theologian, so this is a problem I can relate to as I am his go-to person for how to do....). I often don't know although I can often find a way through the mire, even if not the best way, but this looks truly amazing! As one of the generation of teachers who found themselves in 1989 U.K. National Curriculum Mathematics) having to teach how to use spreadsheets and databases to 11-year-olds, without a moments training in them for ourselves, I have had o find out the hard way how to do most things. I managed to lead the staff, none of whom had a computer on which to practice, to teach these across the whole of the high school, achieving the best results in the county in the national exams, but without retaining much of the information thirty years later. At the moment every time I open Excel I get a blank screen, even on sheets I have been using for years. And I have been totally unable to open new ones.
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments