Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-12-2022, 03:53 PM
Guessed's Avatar
Guessed Guessed is offline VBA to select a specific font type Windows 10 VBA to select a specific font type Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

No, it is not.

Uppercase can be searched for in two different ways according to how it occurs.
1. If the Uppercase is a font formatting attribute applied to regular (upper and lowercase) text then you could change .Bold = True to .AllCaps = True
2. If the text was actually typed only with capital letters then you would need a wildcard search for those specific characters along the following lines
Code:
Sub Seeker()
    Options.DefaultHighlightColorIndex = wdYellow
    With Selection.Find
      .ClearFormatting
      .Replacement.ClearFormatting
      With .Font
        .Name = "Times New Roman"
        .Size = 12
      End With
      .Replacement.Highlight = True
      .Text = "[ABCDEFGHIJKLMNOPQRSTUVWXYZ]"
      .Replacement.Text = "^&"
      .Forward = True
      .Wrap = wdFindStop
      .MatchWildcards = True
      .Format = True
      .Execute Replace:=wdReplaceAll
    End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to select a specific font type Merging two Word documents: 2nd document not maintaining original font type and font size Swarup Word 31 08-28-2018 06:55 PM
VBA to select a specific font type Macro that swaps out font type namedujour Word 3 08-01-2018 01:27 PM
Font Type changes with change in language animex Word 1 09-08-2017 05:23 PM
VBA to select a specific font type Type 1 font d4okeefe Word 3 02-09-2016 01:16 AM
Mysterious Font Type Symbol curiousUser Word 2 08-18-2014 05:10 AM

Other Forums: Access Forums

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