Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2011, 03:14 AM
macropod's Avatar
macropod macropod is offline How to ensure that each line ends only at the margin Windows 7 32bit How to ensure that each line ends only at the margin 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

Hi Walt,



Telling Word to use wildcards is as easy as checking the 'use wildcards' options on the (expanded - click More) Find/Replace dialogue box. The tricky part is in learning how to encode the Find/Replace expressions. The four I gave in my previous post, though fairly simple, give a hint of what can be done.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 02-04-2011, 12:13 PM
Ulodesk Ulodesk is offline How to ensure that each line ends only at the margin Windows 7 How to ensure that each line ends only at the margin Office 2007
Word 2013 Expert Cert
 
Join Date: Sep 2009
Location: Virginia
Posts: 872
Ulodesk is on a distinguished road
Default Replace with nothing?

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.
Reply With Quote
  #3  
Old 02-06-2011, 12:38 AM
WaltR WaltR is offline Windows Vista Office 2007
Competent Performer
 
Join Date: Dec 2010
Posts: 123
WaltR is on a distinguished road
Default

Hi Ulodesk. You're right, thanks for mentioning that. Sometimes it's necessary in that step to replace with a space, though not always. I've seen it both ways.

I never do a whole document at once. Usually I do a few paragraphs at the beginning until I see how it's going. As I get more comfortable I'll do larger sections at a time but it's still a good idea to keep checking. I've seen some documents change several times.
Reply With Quote
  #4  
Old 02-06-2011, 05:15 AM
macropod's Avatar
macropod macropod is offline How to ensure that each line ends only at the margin Windows 7 32bit How to ensure that each line ends only at the margin 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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Margin-less/Borderless Printing tmndi Word 2 08-13-2011 12:48 AM
How to ensure that each line ends only at the margin Margin 'above' footer text? markg2 Word 2 12-28-2010 05:50 PM
Margin Error ??? velohead Word 3 08-10-2010 06:18 AM
Word Minimum Margin rangeshram Word 0 09-24-2008 01:38 AM
top margin - different first page beanz Word 0 06-28-2006 06:32 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft