Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-15-2019, 06:16 AM
gmayor's Avatar
gmayor gmayor is offline Highlight sentences from a list located in another file Windows 10 Highlight sentences from a list located in another file Office 2016
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

You would need either to put the phrases in a table or in separate paragraphs then instead of searching for words you would search for the contents of the table cells or the paragraphs e.g.


Code:
For i = 1 To docRef.Paragraphs.Count
    Set oPara = docRef.Paragraphs(1).Range
    oPara.End = oPara.End - 1
    strFind = oPara.Text
    'do stuff with opara.text
Next i
__________________
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
 

Tags
highlight, vba, word 2016



Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlight sentences from a list located in another file Highlight words from a list Nanaia Word VBA 3 09-07-2018 02:13 PM
Highlight sentences from a list located in another file how to highlight all "indexed" sentences using find and replace? smallxyz Word 2 02-06-2016 02:54 AM
Macro to highlight repeated words in word file and extract into excel file aabri Word VBA 1 06-14-2015 07:20 AM
Error: The file may be corrupted, located on a server that is not responding, or read naeemeh Excel 2 11-20-2011 03:38 AM
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 05:55 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