Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2015, 09:19 PM
jjmartin1340 jjmartin1340 is offline Replacing paragraph formatting before column break also changes the next paragraph after the break Windows 7 64bit Replacing paragraph formatting before column break also changes the next paragraph after the break Office 2003
Novice
Replacing paragraph formatting before column break also changes the next paragraph after the break
 
Join Date: Sep 2015
Posts: 2
jjmartin1340 is on a distinguished road
Default Replacing paragraph formatting before column break also changes the next paragraph after the break

I have a large document with 2 columns per page. I want to change the formatting of the last paragraph in each column. When I use Replace to change ^p^n to ^p^n with new formatting for the replacement, it also changes the formatting of the first paragraph in the next column. Is there any way I can make it change only the paragraph before the break?
Reply With Quote
  #2  
Old 09-21-2015, 09:39 PM
macropod's Avatar
macropod macropod is offline Replacing paragraph formatting before column break also changes the next paragraph after the break Windows 7 64bit Replacing paragraph formatting before column break also changes the next paragraph after the break Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

You would need to use a macro for that, as it appears the column break is attached to the paragraph following it. Such a macro might be coded as:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^p^n"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  Do While .Find.Found
    .Paragraphs.First.Style = "My Style"
    If .End = ActiveDocument.Range.End Then Exit Sub
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-21-2015, 10:42 PM
jjmartin1340 jjmartin1340 is offline Replacing paragraph formatting before column break also changes the next paragraph after the break Windows 7 64bit Replacing paragraph formatting before column break also changes the next paragraph after the break Office 2003
Novice
Replacing paragraph formatting before column break also changes the next paragraph after the break
 
Join Date: Sep 2015
Posts: 2
jjmartin1340 is on a distinguished road
Default easy way to do it

I've been thinking about this for about a year, and just now the answer came to me.
I don't use the @ character in my document.
So I Replaced: ^p^n with @^p^n.
Now the last paragraph in each column contains @.
Now I Replaced @ with @ with the desired formatting.
Then I verified the formatting.
Then I Replaced @ with nothing, thus removing it.
Now the last paragraph in each column is properly formatted, without affecting the next paragraph.

Why did it take me so long to think of such a simple method?
I fall back on my standard answer these days: "I'm 74 years old".
Reply With Quote
  #4  
Old 09-21-2015, 10:50 PM
macropod's Avatar
macropod macropod is offline Replacing paragraph formatting before column break also changes the next paragraph after the break Windows 7 64bit Replacing paragraph formatting before column break also changes the next paragraph after the break Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 jjmartin1340 View Post
Why did it take me so long to think of such a simple method?
I fall back on my standard answer these days: "I'm 74 years old".
Sometimes it just takes a bit of 'thinking outside the box'. At 74, you should have a head start on that
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing paragraph formatting before column break also changes the next paragraph after the break inserting wordwrap table causes paragraph break in text sodiumkpump Word Tables 1 08-05-2015 06:36 PM
Replacing paragraph formatting before column break also changes the next paragraph after the break Insert paragraph break before images jsoule Word VBA 3 02-25-2015 07:53 AM
How can I temporarily break a 3 column format in order to type a single column paragraph William P Word 1 01-04-2015 06:40 PM
Records paragraph break ervilhaman Mail Merge 14 04-09-2013 02:55 PM
URGENT: Mail 'Merge To New Doc' restarts paragraph numbering at each Section break JamesF Mail Merge 0 07-28-2011 07:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:02 PM.


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