Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-04-2023, 10:19 AM
MLe MLe is offline Find out how to change all letter of first word using VBA ? Windows 11 Find out how to change all letter of first word using VBA ? Office 2021
Novice
Find out how to change all letter of first word using VBA ?
 
Join Date: Aug 2023
Posts: 1
MLe is on a distinguished road
Default Find out how to change all letter of first word using VBA ?

Hi,


Sorry Sorry sorry for my english

For my dissertation today at more than 400 pages, I would like to change the style and box of certain words. I found my happiness ... well almost.
In the example below, I need to modify "DESCRIPTION" in one style and "-- remplissage" in another style
This is my macro :

Code:
Sub change ()
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
    Do
        With Selection.Find
            .ClearFormatting
            .Text = "COORDINATION"
            .MatchWholeWord = True 
            .Font.Bold = False
            .Font.Underline = True 
            .Style = "Souligné"
            .MatchCase = True
            .Wrap = wdFindStop
            .Execute
        End With
    If Selection.Find.Found Then
    Selection.Style = ActiveDocument.Styles("NORMAL_01")
               Selection.Range.Case = wdUpperCase
                 End If
     Loop Until Not Selection.Find.Found
End Sub
It's good except that it changes ALL the words "description" and I only want if this one is in capitals or if this one is at the beginning of a sentence

EX :
DESCRIPTION (yes)
This is a description (NO) de my car ...

Thanks in advance and sorry for my english
Reply With Quote
 

Tags
allcaps matchcase



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to only find the first letter of each line? (Word 97) Genericname1111 Word 4 09-11-2019 06:26 PM
Find a letter or symbol with a specific font Lou_Reed Word 1 11-15-2018 09:14 AM
Change Letter Format in Word GR_mahdi Word VBA 1 06-12-2017 08:24 PM
Find out how to change all letter of first word using VBA ? Find and replace with a macro, problem with letter case garcanrya Word VBA 2 01-10-2014 05:40 AM
if letter change font also change gsrikanth Excel 1 05-15-2012 03:03 AM

Other Forums: Access Forums

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