Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2018, 05:44 PM
rfshogren rfshogren is offline Using font name as a field Windows 10 Using font name as a field Office 2016
Novice
Using font name as a field
 
Join Date: Oct 2018
Posts: 1
rfshogren is on a distinguished road
Default Using font name as a field

I want to compare a number of different fonts by printing the same one-page document in each of the fonts. As a way of labelling the documents, I would like to show the font name on each one. I thought of a footer with a field for the font name. However, there seems to be no such field.



Can anyone suggest a way to achieve what I want?
Reply With Quote
  #2  
Old 10-21-2018, 07:56 PM
macropod's Avatar
macropod macropod is offline Using font name as a field Windows 7 64bit Using font name as a field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

The following macro, originally published by MS, will print a list of all installed fonts, including the same sample text for each. You could modify the '.InsertAfter' string to include some representative boilerplate text - even including a page break so that each font is output to a new page. The macro could also be modified to employ only a designated set of fonts.
Code:
Sub ListFonts()
Application.ScreenUpdating = False
Dim ListFont As Variant
With ActiveDocument.Characters
  For Each ListFont In FontNames
    With .Last
      .Font.Name = "Arial"
      .Font.Size = 12
      .Text = ListFont & Chr(11)
    End With
    With .Last
      .Font.Name = ListFont
      .InsertAfter "ABCDEFGHIJKLMNOPQRSTUVWXYZ ~!@#$%^&*()_+|<>?:{}" & Chr(11) & _
        "abcdefghijklmnopqrstuvwxyz `1234567890-=\,.;'[]" & vbCr
    End With
    With .Last
      .Font.Name = "Arial"
      .InsertAfter vbCr
    End With
  Next ListFont
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using font name as a field How to set font size in text-input field of protected form UnicornVestibule Word 5 06-06-2016 10:51 PM
Using font name as a field Looping Macro to Change Font, Font Size, and Give Heading 1 WH7262 Word VBA 1 08-26-2014 03:46 PM
Using font name as a field Unable to format field font - HELP! smarsh Mail Merge 3 06-18-2014 03:56 PM
Using Quick Parts >> Ref >> Field (Third word changing font) sonny49 Word 1 01-07-2014 10:01 AM
Editing the font of text inserted before a merge field clawschieff Mail Merge 6 03-19-2013 07:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:29 AM.


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