Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2016, 01:25 PM
angie450 angie450 is offline Using wildcards in Find/Replace to change font/case Windows 7 64bit Using wildcards in Find/Replace to change font/case Office 2003
Novice
Using wildcards in Find/Replace to change font/case
 
Join Date: Feb 2014
Posts: 6
angie450 is on a distinguished road
Default Using wildcards in Find/Replace to change font/case

Hello, I've been wracking my brain over this...



I have a document typed in all caps (the font is formatted in all caps) and I need to find a way to convert all the text within brackets to sentence case. After much digging, I found the way to convert all the bracketed text to lowercase, but I really need the first letter of each text within those brackets to be capitalized. For example, it needs to look like this:

THIS TEXT CAN STAY IN ALL CAPS. [But this text needs to be in sentence case]

When I look through all the options in the Find/Replace I don't see anything that lets me choose "sentence case". So I'm wondering if there is a step two that is necessary in order to take all the bracketed text and convert it to sentence case. But how would I do that? Can I create a macro or command that takes every character immediately preceded by a [ and changes it to a capital letter? Any help or ideas would be greatly appreciated. Thank you!
Reply With Quote
  #2  
Old 05-25-2016, 03:57 PM
macropod's Avatar
macropod macropod is online now Using wildcards in Find/Replace to change font/case Windows 7 64bit Using wildcards in Find/Replace to change font/case Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

A Find/Replace can't change case that way - a macro would be needed, such as:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "\[*\]"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute
  End With
  Do While .Find.Found
    .Case = wdTitleSentence
    .Characters(2) = UCase(.Characters(2))
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-26-2016, 11:09 AM
angie450 angie450 is offline Using wildcards in Find/Replace to change font/case Windows 7 64bit Using wildcards in Find/Replace to change font/case Office 2003
Novice
Using wildcards in Find/Replace to change font/case
 
Join Date: Feb 2014
Posts: 6
angie450 is on a distinguished road
Default

Hi Paul,

Thank you so much!! This code works beautifully. Now I'm just trying to attach it to a button that I can pin to the toolbar for easy access. Thank you!!

Angela
Reply With Quote
Reply

Tags
format style, sentence case, wildcards



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using wildcards how do I Find and Add to, not replace Stargehzer Word 3 01-25-2016 09:14 PM
Using wildcards in Find/Replace to change font/case Find/replace font colour in all header/footer trillium Word VBA 4 10-20-2015 10:39 PM
Find & Replace: Wildcards (except this pattern) tinfanide Word 6 01-26-2014 06:39 AM
Using wildcards in Find/Replace to change font/case Find and replace with a macro, problem with letter case garcanrya Word VBA 2 01-10-2014 05:40 AM
wildcards in find & replace to reverse word order jeffk Word 3 11-11-2012 01:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:28 PM.


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