Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2021, 06:07 AM
macropod's Avatar
macropod macropod is offline Highlight A Phrase In A Document, Then Find And Replace Something Only In The Highlighted Part? Windows 10 Highlight A Phrase In A Document, Then Find And Replace Something Only In The Highlighted Part? Office 2016
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

As indicated in the code, it is performing a wildcard Find, for which see: Finding and replacing characters using wildcards

In [!^13]{1,}, the:
• [] pair says to find any instance of whatever is defined between them
• ! says to NOT find what follows
• ^13 represents ASCII 13, which is the first character of the ASCII 13 & 11 pair that together create a paragraph break


• {1,} says to continue finding such characters for as long as they go.

Hence:
.Text = "Organization:[!^13]{1,}"
tells Word to find 'Organization:' followed by any series of characters that do not include a paragraph break.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlight A Phrase In A Document, Then Find And Replace Something Only In The Highlighted Part? VBA Find&Replace all bold, itlaic, underlined and highlighted words/characters Kalü Word VBA 22 04-24-2018 05:35 AM
Highlight A Phrase In A Document, Then Find And Replace Something Only In The Highlighted Part? Find, select, and replace part of text with bold paik1002 Word VBA 4 12-07-2015 11:24 PM
Highlight A Phrase In A Document, Then Find And Replace Something Only In The Highlighted Part? Find-replace using part of what was found in the replacement text paulkaye Word 3 12-22-2014 02:52 AM
Highlight A Phrase In A Document, Then Find And Replace Something Only In The Highlighted Part? Find/Replace Wildcard Needed-Bold & Highlight rsrasc Word VBA 3 11-11-2014 03:55 PM
find - reading highlight - highlight all / highlight doesn't stick when saved bobk544 Word 3 04-15-2009 03:31 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:01 AM.


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