Font.SetScriptName method (Publisher)

Sets the name of the font script to use in a text range.

Syntax

expression.SetScriptName (Script, FontName)

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.
FontName Required String The font name.

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.