View Single Post
 
Old 05-09-2009, 12:35 AM
Bird_FAT's Avatar
Bird_FAT Bird_FAT is offline Office 2007
Expert
 
Join Date: Apr 2009
Location: South East
Posts: 271
Bird_FAT is on a distinguished road
Default

Quote:
Originally Posted by Bahir Barak View Post
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.
Reply With Quote