Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 05-09-2009, 12:35 AM
Bird_FAT's Avatar
Bird_FAT Bird_FAT is offline Select text between characters Select text between characters 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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
The characters of my received emails are little squares! HELP! chocolatecookies Outlook 0 12-17-2008 04:17 PM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM
special/escape/insertion characters in word manojbmsce Word 0 09-25-2008 06:40 AM
Select text between characters Making sure the correct number of characters are entered. leroytrolley Excel 1 07-25-2008 06:38 AM
escape characters LadyReader Word VBA 0 09-06-2006 12:09 PM

Other Forums: Access Forums

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