FontName Method

Returns the name of the font by its index in the font collection of the document.

Applies to: Document object

Syntax

[[Let] fontNameRet =] object.FontName ( index )

The FindStyle method syntax has these parts:

Part Description
object Required. An expression, that returns an instance of the Document object.
index Required. An expression that returns a Long value. Represents the index of the font in the font collection of the document.
fontNameRet Optional. A String type variable.

Remarks

If index is less than 1 or greater than the number of fonts in the font collection of the document, the FontName method returns an empty string. Use the FontsNum method to find out the number of the fonts. The inverse method to FontName is the FindFontByName method which returns the index of the font in the font collection by the specified font name.

 

See Also

FindFontByName method, FontsNum method