Full-text indexing of word documents

  • Thread starter Thread starter KC-Fink
  • Start date Start date
K

KC-Fink

I am needing to create an indext at the end of my
documents that includes every word in the document. I
know some third party software vendors offer this, but it
requires you to convert your file to a different format.
Does anyone know how to create a full-text index. Marking
every word in the document as I type can't be the only
answer. Many court reporters require this function.
Thank you,
 
KC,

Fellow MVP Graham Mayor and Doug Robbins have posted a process that while a
bit laborious still beats marking every word as you type. Here again, you
must save a copy of your file as plain text.

The process,.
1. Save a copy of the file as plain text.
2. Open the plain text file and run the following macro:

Sub SortAndCull()
Dim SourceDoc As Document, TargetDoc As Document, awords As Integer,
aword As Range
Set SourceDoc = ActiveDocument
countwords = 0
awords = ActiveDocument.Words.Count
Set TargetDoc = Documents.Add
SourceDoc.Activate
While countwords <= awords
Set aword = SourceDoc.Words(1)
If aword <> vbCr Then
TargetDoc.Range.InsertAfter aword & vbCr
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = aword
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Else
GoTo SortTarget
End If
Wend
SortTarget:
TargetDoc.Range.Sort ExcludeHeader:=False, FieldNumber:="Paragraphs", _
SortFieldType:=wdSortFieldAlphanumeric,
SortOrder:=wdSortOrderAscending
SourceDoc.Close wdDoNotSaveChanges
End Sub

3. This is not going to produce a perfect result. Eliminate any
punctuation, break up any combined words and resort using Table>Sort>By
paragraph.
4. Save this file as a .doc to use as an AutoIndex
5. Reopen your original file and AutoMark using the file created above.
 
Possibly save a copy of your document as a concordance file? Haven't tried,
just brainstorming.
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Back
Top