Find all instances of a recurring text

G

Guest

A long document I'm working on consists of about 20 chapter files and
contains numerous instances of pieces of text that appear in multiple
location throughout the document. For example, one piece of text appears in 4
different chapters. The document was begun before I joined the project, and
no one bothered to make a list of the pieces of text that appear in multiple
locations, to help manage them efficiently.

Each recurring text is contained within its own section and has its own
heading. I've inserted all the chapter files into one file, and then switched
to Outline view to show the headings only, creating what is essentially a
list of all the headings in the document. At least in principle, now all I
have to do is search through this list and identify those headings that
appear in it more than once. But because this list is more than 30 pages
long, finding all the instances of each recurring heading will be a long,
arduous process.

What is a quick, preferably automated, way to identify each recurring text?
Is there a macro that does this? At a bare minimum, the solution should
identify each heading that appears in the list more than once, and either
mark these headings or create a separate list of them. If I just knew the
title of each heading that recurred, I could search through the list to find
all of the instances of each recurring heading. The ideal, most complete
solution would not only identify those headings that recur, but it would also
show the number and location of the occurences of each recurring heading.

Thanks,
Rob
 
D

Daiya Mitchell

You are the person who just learned about IncludeText fields, right, cause I
assume you are going to use them?

Anyhow, some thoughts:
Table | Sort works in Outline View, but appears to only sort on Heading 1.
Okay, why not make a copy of the document, promote all headings to Heading 1
(if not already), then use Table | Sort. All the identical ones should then
be listed together, and you can easily skim the list to see which are
duplicated. That gives you the problem headings.

Make another copy of the doc.*
Use the Find command to find recurring headings, and set it to select all
found results. Then format the text as colored or something so that you will
easily know what to switch out as you go through the document.

Alternatively, in outline view, if it's collapsed, finding the heading and
replacing it with the includetext field might also delete the text after the
heading. Not sure whether the field braces will come through on a Replace
operation. In that case, you might have to use the FindNext command and hit
control-V repeatedly.

*(if I were you, I would make a copy of the doc before getting into the
whole includetext fields thing, just in case you need to start over at some
point).

Hope that helps,
DM
 
D

Dian D. Chapman, MVP

You might want to download a free utility called Word Crayon. You can
enter the terms you want into the Key text and choose a color. Then
the applet will color each of the same terms the same color so you can
easily identify similar items by their color.

See these TechTrax articles for details and you'll find the download
link in the article.

The Word Crayon
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=160

Word Crayon...Revisited
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=506

Good luck...

Dian D. Chapman, Technical Consultant
Microsoft MVP, MOS Certified
Editor/TechTrax Ezine

Free MS Tutorials: http://www.mousetrax.com/techtrax
Free Word eBook: http://www.mousetrax.com/books.html
Optimize your business docs: http://www.mousetrax.com/consulting
Learn VBA the easy way: http://www.mousetrax.com/techcourses.html
 

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