Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-12-2021, 05:38 AM
kae0088 kae0088 is offline Searching font names Windows 7 64bit Searching font names Office 2010 32bit
Novice
Searching font names
 
Join Date: May 2012
Location: Melbourne, Australia
Posts: 20
kae0088 is on a distinguished road
Default Searching font names

When I look at font names they sometimes have a prefix or suffix such as “Cambria (Heading)”, “(Body) Calibri” or “(Default) Times New Roman”.

I want to search for text with specific fonts in VBA but while I can search for the font name such as Calibri but it will not find text with the font “(Body) Calibri”, nor can I find it by setting sFontName = "(Body) Calibri". How can I find these fonts
My code is:

sFontName = "Calibri"
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Replacement.Text = ""
.Format = True
.Text = ""
.Font.Name = sFontName
.Execute
End With
Reply With Quote
 

Tags
vba find and replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching font names General Question on List of Font Names SamDsouza Word VBA 10 02-28-2021 07:24 PM
Searching font names Would like to shortern the coding for searching docx file names in specific directory SamDsouza Word VBA 4 01-06-2021 07:27 AM
Macro for Font Names and Sizes apollox Word VBA 8 06-13-2018 06:00 AM
Formula for searching names in one go SilverChat Excel 2 05-07-2018 06:11 PM
How to enter names in Resource Pool/names pstein Project 1 03-26-2012 07:37 AM

Other Forums: Access Forums

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