FindFontByName Method

Searches for a font by its name in the font collection of the document. Returns the index of the found font in the font collection of the document.

Applies to: Document object

Syntax

[[Let] index =] object.FindFontByName ( fontName )

The FindFontByName method syntax has these parts:

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

Remarks

If the font with the specified name is not found in the font collection of the document, the FindFontByName method returns 0. An inverse operation to FindFontByName is the FontName method, which returns the name of the font by its index in the font collection of the document.

 

See Also

FontName method, FontsNum method