Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2018, 01:02 AM
dita dita is offline Word macro to change ALL CAPS to UPPERCASE Windows XP Word macro to change ALL CAPS to UPPERCASE Office 2010 64bit
Advanced Beginner
Word macro to change ALL CAPS to UPPERCASE
 
Join Date: Apr 2018
Posts: 34
dita is on a distinguished road
Default Change case of text

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!
Reply With Quote
  #2  
Old 05-20-2018, 04:00 AM
eduzs eduzs is offline Word macro to change ALL CAPS to UPPERCASE Windows 10 Word macro to change ALL CAPS to UPPERCASE Office 2010 32bit
Expert
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 05-20-2018, 10:55 AM
dita dita is offline Word macro to change ALL CAPS to UPPERCASE Windows XP Word macro to change ALL CAPS to UPPERCASE Office 2010 64bit
Advanced Beginner
Word macro to change ALL CAPS to UPPERCASE
 
Join Date: Apr 2018
Posts: 34
dita is on a distinguished road
Default

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
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word macro to change ALL CAPS to UPPERCASE Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points 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
Word macro to change ALL CAPS to UPPERCASE Change lower case to caps whole document 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

Other Forums: Access Forums

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