Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-20-2023, 07:48 AM
rfletcher35 rfletcher35 is offline Highlight lines based on a Word Windows 11 Highlight lines based on a Word Office 2021
Novice
Highlight lines based on a Word
 
Join Date: Jun 2023
Posts: 2
rfletcher35 is on a distinguished road
Default Highlight lines based on a Word

I have a script and want to highlight all my lines,
Is there a way to highlight my lines based on a word at the beginning of the line.



So for example. Ken: Done the house, top to bottom.

Is an example line

Hope someone can help

Thanks
Reply With Quote
  #2  
Old 06-20-2023, 08:57 AM
kilroyscarnival kilroyscarnival is offline Highlight lines based on a Word Windows 10 Highlight lines based on a Word Office 2021
Expert
 
Join Date: May 2019
Posts: 358
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

Hi, I think you'll find this post from a long time ago has the code you may be looking for.

https://www.msofficeforums.com/41614-post5.html

Simply substitute "KEN" for "Procedure Step:"
Reply With Quote
  #3  
Old 06-20-2023, 11:10 AM
rfletcher35 rfletcher35 is offline Highlight lines based on a Word Windows 11 Highlight lines based on a Word Office 2021
Novice
Highlight lines based on a Word
 
Join Date: Jun 2023
Posts: 2
rfletcher35 is on a distinguished road
Default

Hi,

Thanks for that, i've tried it and it has highlighted the word but not the line.

It'll work for me though, thank you
Reply With Quote
  #4  
Old 06-20-2023, 02:15 PM
kilroyscarnival kilroyscarnival is offline Highlight lines based on a Word Windows 10 Highlight lines based on a Word Office 2021
Expert
 
Join Date: May 2019
Posts: 358
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

It worked for me in a mockup. It's possible your script is formatted differently.

Could you post a few pages of it?
Reply With Quote
  #5  
Old 06-21-2023, 05:38 AM
gmayor's Avatar
gmayor gmayor is offline Highlight lines based on a Word Windows 10 Highlight lines based on a Word Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,137
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 ofgmayor has much to be proud of
Default

'Lines' in Word are a vague concept.

Paul's code highlights from the word to the next paragraph mark, so if the paragraph is more than one displayed 'line' more than one 'line' will be highlighted.
If the 'lines' are terminated with a manual line break (Shift+Enter) or copied from this forum you may do better with
Code:
.Text = "Ken:[!^13^11]{1,}"
Note that the text is case sensitive.
__________________
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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlight lines based on a Word Macro To Identify & Highlight Words In MS Word Based Upon A List In Excel File Column abhimanyu Word VBA 5 03-20-2020 01:33 PM
How to highlight lines containing specific words SixStringSW Word VBA 4 06-03-2018 03:57 PM
Highlight row based on todays date problem manxman79 Excel 6 11-17-2014 09:06 AM
Highlight lines based on a Word highlight text based on find command alysolyman Word VBA 1 03-27-2013 02:46 PM
Highlight lines based on a Word How to highlight the row based on cell value? Learner7 Excel 1 12-11-2011 02:28 AM

Other Forums: Access Forums

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