View Single Post
 
Old 02-06-2011, 05:15 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Ulodesk View Post
Walt,
Are you certain? I have sometimes run into trouble this way, with Word then running together the last word on a line with the first on the next. when I record a macro to do this kind of operation, I have found it necessary, usually, to replace the single paragraph with a single space.
Hi Ulodesk,

The wildcard Find/Replace sequence I posted takes care of the space issues. Here's how it works:
Find = ([!^13])([^13])([!^13])
Finds any paragraph break that's has a character other than a paragraph break both before and after it. The three sets of parentheses tell Word that the Find expression has three components we want to keep track of.
Replace = \1 \3
Replaces the found paragraph break with a space, keeping the characters before and after. The \1 and \3 correspond with the first and third parentheses from the Find expression.
Find = ([ ])[ ]{1,}
Find a space character followed by one or more additional space characters. The {1,} tells Word that the preceding expression applies to one or more characters.
Replace = \1
Keeps the first space only.
Find = [^13]{2,}
Find any two or more paragraph breaks (note: we can't use ^p in a wildcard Find).
Replace = ^p
Replace with only a single paragraph break (note: using ^13 in a wildcard Replace doesn't create proper paragraph breaks - just line breaks that look like them).
Find = [ ^13]
Find any paragraph break preceded by a space.
Replace = ^p
Replace with only the paragraph break.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote