Generating a list of Unique words and Names

A

Amandeep Madra

I do hope someone can help with this query
I have a 200K word manuscript, to make some of the fact
checking and indexing easier I need to generate a unique
word list. My document includes diacritical marks (all
from the Times New Roman typeface font pack), which means
that the shareware type indexing programs dont work (they
require a text file input, which then loses the marks)

As an additional feature (ideally!) if the macro/function
can recognise real names (due to a sequence of 2-3 words
which have leading caps) that woudl be just perfect

Any help woudl be greatly appreciated
 
G

Graham Mayor

Try the following:

Sub ListWords()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.WholeStory
Selection.Sort ExcludeHeader:=False, FieldNumber:="Paragraphs", _
SortFieldType:=wdSortFieldAlphanumeric,
SortOrder:=wdSortOrderAscending

Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "(*^13){2,}"
.Replacement.Text = "\1"
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.dsl.pipex.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top