a macro to extract specific lines?

S

Steve

I'm looking to write a macro which will extract specific lines of text [ie:
line 6 through line 11] in several word docs and then have it write them to
a new file [comma delimeted .txt would be preferable].

Any advise as to where I should start my research would be greatly
appreciated.

Steve.
 
D

Doug Robbins - Word MVP

Hi Steve,

Is there some more precise way of identifying the text that you want to
extract than by line number? Also what terminates each line? is it a soft
return, and manual line break or a paragraph mark ¶?

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 
J

jesse

If these are documents of which you will see repeatedly,
format them using styles. Pick a unique style to identify
the lines you want to copy and paste:

example:

Format | Style | New | My_Unique_Style

Pick the spacing, font, and paragraph setups to match what
your looking for. Apply this style to the lines you want
to copy.


Next, perform a dry run of your seach to validate your
search routine by clicking, Edit | Find and click the more
button at the bottom.

Click Format | Style and select the unique style you just
set (e.g., My_Unique_Style).

This search will find all instances of this style.

Copy and paste..
 

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