Reply
 
Thread Tools Display Modes
  #1   Report Post  
bahtea bahtea is offline
Junior Member
 
Posts: 1
Default Help Define Range (Word 2003 VBA)

My document, named BOOK.doc, is divided into different sections,
each section separated by bold numbers, running from 1-150.
To find the numbers I use this:
.Font.Bold = True
.Text = "([0-9]){1,3}"
I want to be able to define a range that will cover all texts between
the first number found (as the starting point) AND the next one found
(as the ending point), that is, the texts in Section 1. And, after that,
copy the defined range to be pasted onto a new document, processed,
saved and closed (this part I can handle). From there, return to the
BOOK document, proceed on to the next section numbers, ie, 2 and 3,
and so on to the end of the document.

I've been at this for a little more than a week. But my code is only patchwork,
copied from this and that source, and thus fails to work as desired. And I'm
ashamed to show my code, pardon me. I, however, visualise the structure
as something like so:

Dim SectionRange
Do While
From Cursor point
Find...1
Set as range.start

Find...2
One character before the no.
Set as range.end

Range.copy

Create a new doc
Edit/process
Save as section no.doc
Close

Selection/range collapse at end

Loop

Help will be very much appreciated.

Last edited by bahtea : September 23rd 10 at 05:36 AM Reason: Added more details
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying large range of excel data to Word 2003 as Link grapenutz Page Layout 3 March 19th 09 03:27 PM
Re Word 2003: How do I define a cell as a header cell? John Kwasnik Tables 4 September 5th 08 11:44 PM
New Merge Document and Printing Page Range (for Word 2003) Sharon Microsoft Word Help 1 May 22nd 08 10:53 PM
Word 2003 Selection or Range Objects Lako Microsoft Word Help 2 March 8th 06 11:31 PM
startup of Word 2003 and visual basic and "Subscript out of Range. JDH Microsoft Word Help 1 March 1st 06 06:00 PM


All times are GMT +1. The time now is 03:56 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"