Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-23-2014, 03:26 PM
macropod's Avatar
macropod macropod is offline Changing color font between 2 specific flags Windows 7 32bit Changing color font between 2 specific flags Office 2010 32bit
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

You don't actually need a macro for what you've described; it could also be done with a wildcard Find/Replace, where:
Find = /Ex:*/Ex
Replace = "^&"
and you specify the replacement font colour. A macro equivalent is:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Font.ColorIndex = wdRed
    .Text = "/Ex:*/Ex"
    .Replacement.Text = "^&"
    .Format = True
    .Forward = True
    .Wrap = wdFindContinue
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing the font color dbsoccer Project 1 11-01-2013 06:21 AM
changing color aerospace Outlook 0 04-03-2013 05:56 AM
Changing bar color automatically Mahmuz PowerPoint 0 03-28-2012 11:49 PM
Changing the margins on a specific paragraph Xmosis Word 1 03-15-2011 02:04 PM
changing font size without changing leading carolns Word 1 09-14-2009 12:30 PM

Other Forums: Access Forums

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