OMG ! I could delete an index in Microsoft word?


No, this post doesn’t fit the context of this blog and I know that 🙂

It isn’t about socially social media or the newest version of ‘Web’. But it is a useful tip, that all Market researchers who prepare research-reports and executive summaries are perhaps going to appreciate. Needless to mention, this post is focused towards advanced users of Microsoft word.

Problem – How to delete all index entries from a Microsoft word document [Don’t ask me why would somebody want to delete an index 😉 I am assuming the problem is already there !!]

What is an index? – Remember the search-index that you had at the back of your book in your hay-days ? The one that you could use to identify wherever your favorite keyword in the book was present.

Assumption – You have already created a word document with those countless index entires.

Trick 1

1.  In your word document, open the find & replace window by pressing  Ctrl + F

2. Click on the ‘More’ button

3. Click on the ‘Special’ button and select ‘Field’

find_nd_replace_2

4. Click on ‘Replace all’ button and you’re home all the index entries disappear

find_nd_replace_3

Catch Along with the index entries it also replaces your ‘TOC’ [Table of Contents] and ‘List of Figures & Tables’.

Trick 2 [Exclusively for index]

  1. With the Word document open, press [Alt][F11] to launch the Visual Basic Editor (VBE).
  2. Select Module from the insert menu
  3. Enter the following code in ‘Macro’ and hit the run button to delete all index entries
Sub DeleteIndexEntries()
  Dim doc As Document
  Dim fld As Field
  Set doc = ActiveDocument
  For Each fld In doc.Fields
    fld.Select
    If fld.Type = wdFieldIndexEntry Then
      fld.Delete
    End If

  Next
  Set fld = Nothing
  Set doc = Nothing
End Sub

Credits – Customized avtaar of TechRepublic’s article on Remove field codes from Word documents with this handy macro

Reblog this post [with Zemanta]

19 Comments

Filed under Tech, Web 2.0

19 responses to “OMG ! I could delete an index in Microsoft word?

  1. Stuart H Warren

    Or do a search & Replace for ^d XE in the search field and leave the replace field blank.

  2. Awesome! The message I received was that it replaced 680 entries. Hallelujah. That would have taken me forever one by one. Thank you!

  3. Peter Mitchell

    Thanks for your very helpful advice; I have bookmarked the page. I have a written a long article of almost 90 pages and have been trialling an index, and was terrified I would have to do a manual deletion of my entries. Thanks once again! Peter,
    Perth Western Australia

  4. Richard

    Well done, you!
    This worked perfectly!

  5. Peter

    I failed to move the index by using the method you have suggested

  6. TwT

    I have tried both tricks but nothing works, I guess I made index entries and messed up with them a bit, now I’m trying to remove thos tiny pieces of code but it just won’t go… :((

  7. Z.Z.

    Hi,
    Could u help me to delete one special index not all indexes, for instance word water is indexed in a file by mark all and now I want to remove the index of this word.

    • In the search field you would put
      ^d XE “water”

      This also work as an easier workaround than solution #2 proposed here. If you want to delete all index entries and leave other fields and TOC, replace
      ^d XE
      with nothing, and all the index entries will be removed.

  8. Adelbert

    Wow really great. You just saved my life with a big document which I indexed and then accidentally saved.
    I used option 1. In MS Word 2010 the Table of contents is NOT affected anymore and I found nothing else affected.
    The other advice I got was to remove the index fields {XE fields} one by one.
    Thanks Adelbert

  9. Sara

    I’m a book editor, and my new client inserted indexing codes before the manuscript was even ready to sent to me for editing. She asked me if I could figure out how to delete the codes, and you made me look really good by giving me this easy method (I used Trick 1). So, many thanks!

  10. Gillian Dooley

    Thank you! For some reason Word was automatically indexing my doc and I was deleting them one by one until I found your tip!

  11. Thanks for this. I changed my mind about the way I was indexing a manuscript and needed a way to start over – your solution worked just great!

  12. works great Thanks ! How do I adapt the VBE code to also erase index entries in footnotes ?

  13. Kind Stranger

    Remove “fld.Select” to speed-up the process.

  14. Leslie

    Also many thanks! Saved me hours

  15. alexis

    GOOOODDDDDDD

  16. don

    this trick just saved me. thanks so much. i was ready to scream. the index i had messed up just would not go away so i could start again.

    • Oh thank goodness! I’m a first time author. My publisher says “You must submit an index with your namuscript.” So OK, no problem, I make an index. Then she says, “Not like that!” Grrrrr…

Leave a comment