Quote:
Originally Posted by Bahir Barak
Hi my dear Bird Fat thanks alot for this useful instructions,
but i need to select text automatically between two quotes in MS WORD 2003 , and want to change its font type just to bold , if you had write for me VBA code for this command , I will be very thinkful for you ,
I am waiting for u ......
|
Code:
Sub Find_and_Font()
'
' Code written by Bird_FAT
' This script uses the wildcard '*' to look for text between
' two other characters, then changes the font of the text.
' The While/Wend statement at the end causes it to
' loop until it reaches the end of the document.
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "_*_" '<------ Change the search choice
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
While Selection.Find.Execute
Selection.Font.Italic = wdToggle '<------ Change the Font choice
Wend
End Sub
Just use the code from before and change the '
find' choice (put the characters you are looking for on either side of the *) and the word '
italic' for '
bold' in the line before '
Wend' - See the red markers above.