Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Selecting Specific text while keeping place in a document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kudruu@gmail.com - 08 Jun 2007 18:19 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.