Urgent help need for line break macro plssssssss

T

Thejan Mendis

Hi everybody,

I just thought somebody can help me to create a macro with following
functions.

I have some text document each has two potions

-HEAD-
..
..
..
-BODY-

---------SAMPLE----------

-DATE- 20030601
-ISSU- June 2003
-PAGE- 96
-SECT- jhhkhrthehrkht
-HEAD- Every job i ever had, people always seemed to want to think
small,"**(70 charachter limits)
says Geoffrey Ballard by way of explaining why he went into
-BYLN- fgdfhggdfjg
-TYPE- ***
-SUBJ- efforts to promote vehicles powered by zero-emission hydrogen-***
based fuel cells have earned him such accolades
-NAME- ***


-BODY-

I said this years ago and I see no reason to change my mind: The
family-owned, garaged vehicle is the last vehicle that's going to
get a fuel cell. Fuel cells are still 30 times the cost of what
they need to be for the automotive market. We will need to have
huge experimental fleets, where we will put hundreds of people in
controlled environments and see what they do with these vehicles.
Are people going to be buying them and taking them apart to see ho
they work? What sort of problems are we going to create? I doubt
that I will ever see a hydrogen car for personal consumption in a
showroom. But I am certainly going to struggle to stay alive long
enough to see the fleets change--army vehicles, taxis, trucks and

----------------------SAMPLE END-----------

* in the head part there will text and it should not exceed 70 characters
per line. if its gos to more than 70 characters, macro has to put enter or
para break. but it should not break from the middle of a word.

* in the body part, also same rule but charachter limits is 73.



Please help me some


Thejan
 
W

Word Heretic

G'day "Thejan Mendis" <[email protected]>,

do a find on a keyword that starts section 2

define two ranges, part1 and part2 based on the start of that find

part1 = doc.start - find.start and part2 is find.start - doc.end

iterate

dim para as paragraph
for each para in part1.paragraphs
if len(para.range.text)>70 then....



Thejan Mendis said:
Hi everybody,

I just thought somebody can help me to create a macro with following
functions.

I have some text document each has two potions

-HEAD-
.
.
.
-BODY-

---------SAMPLE----------

-DATE- 20030601
-ISSU- June 2003
-PAGE- 96
-SECT- jhhkhrthehrkht
-HEAD- Every job i ever had, people always seemed to want to think
small,"**(70 charachter limits)
says Geoffrey Ballard by way of explaining why he went into
-BYLN- fgdfhggdfjg
-TYPE- ***
-SUBJ- efforts to promote vehicles powered by zero-emission hydrogen-***
based fuel cells have earned him such accolades
-NAME- ***


-BODY-

I said this years ago and I see no reason to change my mind: The
family-owned, garaged vehicle is the last vehicle that's going to
get a fuel cell. Fuel cells are still 30 times the cost of what
they need to be for the automotive market. We will need to have
huge experimental fleets, where we will put hundreds of people in
controlled environments and see what they do with these vehicles.
Are people going to be buying them and taking them apart to see ho
they work? What sort of problems are we going to create? I doubt
that I will ever see a hydrogen car for personal consumption in a
showroom. But I am certainly going to struggle to stay alive long
enough to see the fleets change--army vehicles, taxis, trucks and

----------------------SAMPLE END-----------

* in the head part there will text and it should not exceed 70 characters
per line. if its gos to more than 70 characters, macro has to put enter or
para break. but it should not break from the middle of a word.

* in the body part, also same rule but charachter limits is 73.



Please help me some


Thejan

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 

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