Font.GetScriptName method (Publisher)

Returns a String that represents the name of the font script being used in a text range.

Syntax

expression.GetScriptName (Script)

expression A variable that represents a Font object.

Parameters

Name Required/Optional Data type Description
Script Required PbFontScriptType The script name. Can be one of the PbFontScriptType constants declared in the Microsoft Publisher type library.

Return value

String

Example

This example verifies that the default font script in use for the specified text range is Tahoma, and if not, sets it as the default font script.

Sub GetScript() 
 With ActiveDocument.Pages(1).Shapes(1) _ 
 .TextFrame.TextRange.Font 
 If .GetScriptName(Script:=pbFontScriptDefault) <> "Tahoma" Then 
 .SetScriptName Script:=pbFontScriptDefault, _ 
 FontName:="Tahoma" 
 End If 
 End With 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.