Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-22-2014, 01:44 PM
flatop flatop is offline Adapt a script used in Word to highlight words, to work in Outlook? Windows 7 64bit Adapt a script used in Word to highlight words, to work in Outlook? Office 2010 64bit
Novice
Adapt a script used in Word to highlight words, to work in Outlook?
 
Join Date: Jul 2013
Posts: 5
flatop is on a distinguished road
Smile Adapt a script used in Word to highlight words, to work in Outlook?

Hello, I am currently using the script below in Word 2010 to highlight specific words. Is it possible to adapt it to work in Outlook to search for the the same words in a Post? I believe the script was originally posted by Macropod in the Word forums and he suggested I post the question here. If it is not possible to adapt it, does anyone know how to write a similar script to accomplish the same?

Sub HiLightList()
Application.ScreenUpdating = False
Dim StrFnd As String, Rng As Range, i As Long
StrFnd = "display,e/monitor,e/port,mouse,keyboard,case,wide,screen,monitor,e-port"
On Error Resume Next
For i = 0 To UBound(Split(StrFnd, ","))
Set Rng = ActiveDocument.Range
With Rng.Find
.ClearFormatting
.Text = Split(StrFnd, ",")(i)
.Replacement.ClearFormatting
.Replacement.Highlight = True
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue


.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = True
.Execute Replace:=wdReplaceAll
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
Next
Set Rng = Nothing
Application.ScreenUpdating = True
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adapt a script used in Word to highlight words, to work in Outlook? Find and highlight multiple words in MS Word document AtaLoss Word VBA 37 09-22-2021 12:04 PM
Adapt a script used in Word to highlight words, to work in Outlook? VBA to highlight words if used too much aolszewski Word VBA 3 11-23-2013 02:07 AM
permanently highlight searched words in word 2013 arjay Word 4 08-16-2013 09:29 AM
Adapt a script used in Word to highlight words, to work in Outlook? Highlight all underlined words zdodson Word VBA 1 07-11-2013 04:53 PM
Adapt a script used in Word to highlight words, to work in Outlook? Macro to highlight words bertietheblue Word VBA 9 07-01-2013 12:39 PM

Other Forums: Access Forums

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