Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-06-2016, 11:33 PM
DougMVP DougMVP is offline Need help with modifying a replacing font VBA code- similar task but subtle change Windows 7 32bit Need help with modifying a replacing font VBA code- similar task but subtle change Office 2010 32bit
Advanced Beginner
 
Join Date: Nov 2013
Posts: 50
DougMVP will become famous soon enough
Default

Use

Code:
 
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
    Do While .Execute(FindText:="\(insert * emoji\)", MatchWildcards:=True, Forward:=True, Wrap:=wdFindStop) = True
        With Selection
            If MsgBox("Click OK to colorize selection", vbOKCancel) = vbOK Then
                .Range.Shading.BackgroundPatternColor = wdColorYellow
            End If
            .Collapse wdCollapseEnd
        End With
    Loop
End With
If you just want the colorizing to happen without click OK each time, delete the If and EndIf lines, leaving the .Range.Shading.BackgroundPatternColor = wdColorYellow line.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with modifying a replacing font VBA code- similar task but subtle change Displaying Code in a task usage view ksa5024 Project 1 06-15-2016 06:15 PM
Is there an option to choose font color when replacing text in Excel 2003? chr2014 Excel 8 11-14-2014 09:13 PM
Need help with modifying a replacing font VBA code- similar task but subtle change Looping Macro to Change Font, Font Size, and Give Heading 1 WH7262 Word VBA 1 08-26-2014 03:46 PM
Need help with modifying a replacing font VBA code- similar task but subtle change Make Font Dropdown Change All Styles' Font trevorhiller Word 1 04-14-2012 02:14 AM
modifying rule to show new mail envelope in task bar mlov83 Outlook 5 02-11-2011 01:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:32 PM.


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