PDA

View Full Version : Select paragraphs between words



mathzhang
11-22-2010, 02:44 AM
Hi Guys,

I have a bunch of rtf files from which I need to extract the paragraphs between certain words. Here is what I want to do:

1. Open file: "file1.rtf"

2. Select the paragraphs between "item 1" and the next "item 2". It might have multiple occuances:

Item 1
...
...
Item 2

Item 1
...
...
Item 2

3. Copy and paste the selected paragraphs into a seperate word file.

Any help is greatly appreciated. Thanks!

macropod
11-22-2010, 03:16 AM
Hi mathzhang,

What have you coded so far? Post your code and tell us which part(s) you're having trouble with and we'll see how we can help you solve the problems.

For some code to loop through all files of a given type in a folder, see the code I've posted at:
http://www.vbaexpress.com/forum/showthread.php?t=34992