![]() |
|
#1
|
|||
|
|||
![]()
Hi guys,
I posted a question similar to this in another thread but would need to go further on this function. I have a document which have certain parts of text in ALL CAPS and some others in SMALL CAPS. So I am looking for a macro that changes such instances of text in "ALL CAPS" to uppercase. And any piece of text in "SMALL CAPS" to lowercase. Can this be done with a macro in one go? Many thanks! |
#2
|
|||
|
|||
![]()
You asked something like this in my post above that you can use as a response with only minor adaptations.
__________________
Backup your original file before doing any modification. |
#3
|
|||
|
|||
![]()
Thatīs correct. However, I tried to tweak the code provided in the other post but did not work when I added the case change SMALL CAPS to lowercase:
With ActiveDocument.Range With .Find .Text = "*" .Font.ALLCAPS = True .Replacement.Font.ALLCAPS = False .Replacement.Text = "^&" .Forward = True .Wrap = wdFindStop .MatchWildcards = True .Format = True .Execute End With Do While .Find.Found .Case = wdUpperCase .Collapse wdCollapseEnd .Find.Execute Loop End With With ActiveDocument.Range With .Find .Text = "*" .Font.SmallCaps = True .Replacement.Font.SmallCaps = False .Replacement.Text = "^&" .Forward = True .Wrap = wdFindStop .MatchWildcards = True .Format = True .Execute End With Do While .Find.Found .Case = wdLowerCase .Collapse wdCollapseEnd .Find.Execute Loop End With End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
CrossReach | Word VBA | 2 | 11-13-2017 09:21 AM |
How to find CAPITALIZED names and change them into small caps | dylan.ve | Word VBA | 5 | 02-25-2016 03:15 PM |
![]() |
lmb100 | Word | 4 | 08-07-2015 06:57 AM |
Using conditional formatining to change to all caps | Shades | Excel | 3 | 05-05-2014 06:05 AM |
find&replace word in uppercase with word in lowercase | andrei | Word | 3 | 10-03-2011 05:11 AM |