Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best Practices Looping Paragraphs that Aren't Really Paragraphs

Status
Not open for further replies.

BeckyMc

Technical User
Jun 19, 2001
51
US
I have a document with hard carriage returns at the end of each line whether it's supposed to be a new paragraph or not (VBCR).

The first paragraph is cleaned up and turned into a true paragraph. I want to now go to the next paragraph and turn it into a true paragraph as well with a VBCR only at the end of the true paragraph but I'm afraid to really loop through

for each paragraph.

If there's a VBCR at the end of each line I"m thinking each line would be seen as a paragraph and would miss the whole point.

These paragraphs are going to be varying in number and line length. I'm wondering the best way to loop through them would be.

I know I'm done when I reach a section that starts with "Respond in writing".

Is there a good way to loop through this when my paragraphs aren't "really" paragraphs?

The clean up code is working so nicely for the first paragraph which starts with "Dear..."

I also note that I've been crashing using "FIND" which may be because of my code and I'm in an incredible hurry so reformatting the source (an access report, exported to RTF and then copied to a template, then Save AS is used to create the word file) as we're in an extreme deadline.

Thanks for all the help so far. It's incredibly appreciated!! I have one other programmer to talk to in this office who has fairly different outputs from mine so the concepts don't "synch up" very often! Thankfully my supervisor does understand basic concepts really well.
 
Hi Becky,

See my post in your other thread. Basically, the problem you have to address is that Word cannot diferentiate physical paragraphs from logical ones - it's up to the user to do that. Typically, what one finds is that documents with a paragraph break at the end of each line in a logical paragraph also have two or more paragraph breaks between the logical paragraphs. The macro I posted in the other thread assumes such to be the case and takes care of situations where there may or may not be a space character either side of the paragraph break within the logical paragraphs.

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top