Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2017, 11:32 AM
CrossReach CrossReach is offline Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points Windows 10 Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points Office 2016
Advanced Beginner
Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points
 
Join Date: Jun 2015
Location: In my head
Posts: 70
CrossReach is on a distinguished road
Default Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points

I have many documents that use small caps. Looks great, but when converted to Kindle they are changed to small caps, which then looks ugly. The original editor did not capitalize the words needed. Even though they are all small caps, if the word was capitalized then they would appear like that when reduced to small caps. i.e. the large cap would remain.



So how would I go about creating a Macro that changed every instance of Small Caps in a document to All Caps while dropping each selection by two font sizes (so they appear relatively the same size as when they were small caps)?
Reply With Quote
  #2  
Old 11-12-2017, 03:59 PM
macropod's Avatar
macropod macropod is offline Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points Windows 7 64bit Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,786
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Format = True
    .Font.SmallCaps = True
    .Replacement.Font.AllCaps = True
    .Replacement.Font.SmallCaps = False
    .Forward = True
    .Wrap = wdFindStop
    .MatchWildcards = True
    .Text = "[A-Z]"
    .Replacement.Text = "^&"
    .Execute Replace:=wdReplaceAll
    .MatchWildcards = False
    .Text = ""
    .Replacement.Text = ""
    For i = 12 To 36
      .Font.Size = i / 2
      .Replacement.Font.Size = i / 2 - 2
      .Execute Replace:=wdReplaceAll
    Next
End With
Application.ScreenUpdating = True
End Sub
As coded, the macro will resize all lower-case small-caps text between 6pt & 18pt to all caps 2pt smaller. All upper-case small-caps text is retained as all caps at the original size.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 11-13-2017, 09:21 AM
CrossReach CrossReach is offline Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points Windows 10 Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points Office 2016
Advanced Beginner
Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points
 
Join Date: Jun 2015
Location: In my head
Posts: 70
CrossReach is on a distinguished road
Default

That's great! Will save me so much time. Thank you.
Reply With Quote
Reply

Tags
large caps, macros, small caps

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find CAPITALIZED names and change them into small caps dylan.ve Word VBA 5 02-25-2016 03:15 PM
Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points Include small caps in hierarchical multi-level list Hardbottle Word 1 06-20-2015 05:12 AM
Using conditional formatining to change to all caps Shades Excel 3 05-05-2014 06:05 AM
Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points small caps auto check gene Word 1 12-03-2011 03:04 PM
French accents in small caps nuitsdete Word 0 09-23-2011 01:53 AM


All times are GMT -7. The time now is 06:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft