Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 02-01-2011, 02:11 PM
macropod's Avatar
macropod macropod is offline Change fonts of a defined word with VBA Windows 7 32bit Change fonts of a defined word with VBA Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

Hi Michael,

You could keep adding:
.Text = "Stringtofind"
.Execute Replace:=wdReplaceAll
expressions before the 'End With' line, or you could use code like:
Code:
Sub ColourChange()
Application.ScreenUpdating = False
Dim arrWords, i As Long
arrWords = Array("FQCN73", "2nd string", "3rd string")
With ActiveDocument.Content.Find
  .ClearFormatting
  .Forward = True
  .Wrap = wdFindContinue
  .Format = True
  .MatchCase = True
  .MatchWholeWord = True
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  With .Replacement
    .ClearFormatting
    .Text = "^&"
    .Font.Color = wdColorRed
  End With
  For i = 0 To UBound(arrWords)
    .Text = arrWords(i)
    .Execute Replace:=wdReplaceAll
  Next
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
"Change Word Options" don't change ADKREV Word 0 11-12-2010 10:56 AM
How to make styles defined in one document available to ALL other documents, period. wornways Word 1 08-05-2010 09:09 PM
Change Default Font Word datuk.ahmad Word 3 03-09-2010 04:47 PM
TOC printing Error Bookmark not Defined techexpressinc Word 0 12-14-2008 05:24 PM
Change fonts of a defined word with VBA Defined Views in Tasks Inga Office 3 07-20-2005 07:10 AM

Other Forums: Access Forums

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