Hi,
I am writing a macro for a huge word document that will label certain
conditions (from about 1-2000) and will isolate the sections and
conditions of these conditions and place them into a neatly formatted
CSV file.
The document is in this kind of format:
*********
(bold)1.2.3.4 HEADER(/bold)
Here is a condition and a keyword[number] that is indexed.
Here is another condition and a keyword[number] that is indexed.
(bold)2.3.4.5 HEADER(/bold)
Here is a condition and a keyword [number] that is indexed.
********
The problem I am having is how to get word to first extract the number
before the header, then the header itself. I also don't know how to
look at each keyword and work backwards to find a carriage return
(another another keyword) and forward to the next period (or next
carriage return) in order to properly index a CSV file like this:
Index, keyword, Header Number, HEADER, Description
The keyword is always the same word and only indicates a numbered
condition.
Right now my macro will label all of the keywords but it will not find
headers, numbers, or extract the descriptions.
Any help would be greatly appreciated,
Thanks!
Graham Mayor - 09 Jun 2007 08:48 GMT
You should look at http://www.gmayor.com/replace_using_wildcards.htm which
demonstrates how to identify strings and how to manipulate them.
If you want more direct help you need to post a sample of the document
(change any names if commercially sensitive) with sufficient sections to
show any variations and an exact example of the result you expect to
achieve.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Hi,
> I am writing a macro for a huge word document that will label certain
[quoted text clipped - 27 lines]
> Any help would be greatly appreciated,
> Thanks!