Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2017, 06:00 PM
Volle13 Volle13 is offline How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]" Windows 7 64bit How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]" Office 2007
Novice
How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]"
 
Join Date: Dec 2016
Posts: 14
Volle13 is on a distinguished road
Post How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]"

Using wildcards in the "Find What" box to find "Rule ##" was easy but apparently, they can't be used in the "Replace With" box.



What I'm trying to do is replace this format:

RULE 45
Some Text Could Be One To Several Words Long


to

RULE 45 - Some Text Could Be One To Several Words Long

My purpose here is to have a cleaner table of contents. Using the latter format with style, the resulting ToC would look like:

RULE 45................................................ ......................52
Some Text Could Be One To Several Words Long.................52


Whereas the latter format would result in something cleaner:

RULE 45 - Some Text Could Be One To Several Words Long...52

Last edited by Volle13; 06-08-2017 at 06:26 AM.
Reply With Quote
  #2  
Old 06-07-2017, 10:55 PM
gmayor's Avatar
gmayor gmayor is offline How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]" Windows 10 How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]" Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Replace
(RULE [0-9]{1,})*^13
with
\1
where \1 is followed by a space and with the Wildcard option set.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]" The "body of text" for all odd-numbered pages are all "vertically-centered-aligned". keepcalmandreadabook Word 5 03-27-2017 04:08 PM
Replace "comma" with "and" in line of text audioman Word VBA 7 01-21-2016 03:11 PM
How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]" Erroneously checked "Ignore Rule" while editing BorderDrama Word 1 12-11-2014 01:40 AM
How to replace "RULE ## ^p [TEXT]" to "RULE ## - [TEXT]" Temporarily Removing "Email Delay" Rule tac383 Outlook 2 12-01-2011 01:19 PM
Business Contact Manager "assigned to" restriction rule? kossae Outlook 0 05-25-2011 10:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:50 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