Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-24-2017, 10:18 AM
iwonder iwonder is offline Capitalized words to smallcaps on user approval Windows 10 Capitalized words to smallcaps on user approval Office 2013
Novice
Capitalized words to smallcaps on user approval
 
Join Date: Jun 2017
Location: France
Posts: 10
iwonder is on a distinguished road
Default Capitalized words to smallcaps on user approval

Hi !

I'm using the following code (adapted from Macropod's code [thanks to him !]) to do the job on all concerned words (2 characters or more) of the document, and it works fine.

But now I'd like the user to be asked if he wants the replacement with SmallCaps or not (if not, nothing will be changed) on each capitalized word found.
Could someone help me ?
Hope my English is clear enough...

Code:
Sub ALLCAPS_TO_SMALLCAPS()
'
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "<[A-Z][A-Z]*>"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute
  End With
  Do While .Find.Found
    .Case = wdTitleWord
    .Font.SmallCaps = True
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
I'm not a coder at all, just trying to adapt codes that I find, to my own needs.
Reply With Quote
 

Tags
allcaps smallcaps user



Similar Threads
Thread Thread Starter Forum Replies Last Post
Staged Approval - Fillable Form - Digital Signature Barters Word 0 06-03-2015 06:02 PM
Capitalized words to smallcaps on user approval How to keep a word with capitalized first letter, but not at the beginning of a sentence? xiangwulu Word 4 10-31-2014 09:00 AM
change non capitalized text to capitalized text antoniob Excel 8 10-13-2014 09:11 AM
Capitalized words to smallcaps on user approval weird smallcaps phenomenon franklekens Word 8 08-31-2014 12:35 AM
Is there a way to find CAPITALIZED words in a doc? Bobosmite Word 8 01-28-2014 03:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:32 AM.


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