Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-06-2021, 05:28 AM
Matt C's Avatar
Matt C Matt C is offline Check the font attached to a template's "Normal" style and report if it's not installed Windows 10 Check the font attached to a template's "Normal" style and report if it's not installed Office 97-2003
Advanced Beginner
Check the font attached to a template's "Normal" style and report if it's not installed
 
Join Date: May 2021
Location: London, UK
Posts: 30
Matt C is on a distinguished road
Question Check the font attached to a template's "Normal" style and report if it's not installed

Hi folks.

I found this useful code on Adam Dimech's Coding Blog which checks to see if the User has the required template font installed on their computer and reports with a Message Box.

However, I'd like VBA to check for whatever font has been set in the "Normal" style when creating a new, or opening an existing, document based on the template, rather than specifying a font name in the code.

Quote:
Sub FontCheck()
'
' With thanks to Adam Dimech's Coding Blog (Adam Dimech's Coding Blog)
'
Dim lFound As Boolean
Dim font As Variant

font = "Courier Final Draft" 'This is where I'd like it to check the "Normal" style font
Let lFound = False

For Each aFont In Application.FontNames
If aFont = font Then
Let lFound = True
End If

Next aFont

If lFound = False Then
Call MsgBox("Please install the font '" & font & "' before using this template.", vbExclamation, "Required font missing")


End If
End Sub
Thanks in advance, folks.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Changes have been made that affect the global template, Normal.dotm. ..." DBlomgren Word 11 12-18-2017 12:54 PM
Setting Font Color and Style "permanently" wings1080 Word 5 12-19-2014 08:44 AM
Check the font attached to a template's "Normal" style and report if it's not installed Documents hung up, Word won't close due to "Changes made..to global template Normal.dotm" pagskg Word 2 07-23-2014 12:54 PM
Style doesn't enforce "Do not check spelling" Jennifer Murphy Word 7 01-30-2012 12:51 AM
Check the font attached to a template's "Normal" style and report if it's not installed "Table of content" based on "Normal Style" behavior!!!! Jamal NUMAN Word 4 07-08-2011 04:12 AM

Other Forums: Access Forums

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