What is the easiest way to check if a particular font is installed using VBA?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
OK, true to form I found a solution 30 seconds after posting this. This is despite a 10 minute search before resorting to SO….
List installed fonts
The procedure listed below displays a list of installed fonts in Column A of the active worksheet. It uses the
FindControlmethod to locate the Font control on the Formatting toolbar. If this control is not found (i.e. it was removed by the user) a temporary CommandBar is created and the Font control is added to it.Is a font installed?
The function below uses the same technique as the ShowInstalledFonts procedure. It returns True if a specified font is installed.
The statement below demonstrates how to use this function in a VBA procedure. It displays True in a message box if the user’s system contains the Comic Sans MS font.
The above was originally at this URL, retrieved from the Internet Archive on 2020-02-05.