Easier Way to Mark Index Items Word 2010?

  • Thread starter Thread starter Leslie Coover
  • Start date Start date
L

Leslie Coover

After text has been highlighed, the shortcut keys to mark an item in Word 2010 are:

• Alt + Shift + X
• Press Enter
• Press ESC
• Ctrl + Shift + *

I tried to make a macro to combine these steps into one shorcut. When I use my shortcut on the first entry it appears in my document when I show paragraph marks (¶) and when I create an Index. However, on the next entry it appears when ¶ is selected, but not when I update, or recreate the Index.

Any suggestions welcomed. I would like to find an easier way to mark an index item rather than going through all the steps listed above.

☼☻☼
 
If you want to quickly create a main index entry (no cross-references or
sub-entries) based on the current selection, just run the following macro:

Sub InsertMainIndexEntryFromSel()
If Selection.Range.Text = "" Then
MsgBox "Nothing is selected. Please try again."
Exit Sub
End If
ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, Entry:= _
"Selection.Range.Text", Bold:=False, Italic:=False
ActiveWindow.ActivePane.View.ShowAll = False
End Sub

Save the macro in Normal.dotm and assign a button on the Quick Access
Toolbar to it. See http://www.gmayor.com/installing_macro.htm.
 
Sorry, I spotted an error. Use this macro instead:

Sub InsertMainIndexEntryFromSel()
If Selection.Range.Text = "" Then
MsgBox "Nothing is selected. Please try again."
Exit Sub
End If
ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, Entry:= _
Selection.Range.Text, Bold:=False, Italic:=False
ActiveWindow.ActivePane.View.ShowAll = False
End Sub
 
Thank you so much Stefan, the code works perfectly and the Idiots' guide to installing macros was very helpful.

Leslie Charles
 
Back
Top