Fields.AddPhoneticGuide method (Publisher)

Returns a Field object that represents phonetic text added to the specified range.

Syntax

expression.AddPhoneticGuide (Range, Text, Alignment, Raise, FontName, FontSize)

expression A variable that represents a Fields object.

Parameters

Name Required/Optional Data type Description
Range Required TextRange The text in the publication over which the phonetic text is displayed.
Text Required String The phonetic text to add.
Alignment Optional PbPhoneticGuideAlignmentType The alignment of the added phonetic text.
Raise Optional Variant The distance (in points) from the top of the text in the specified range to the top of the phonetic text. If no value is specified, Microsoft Publisher automatically sets the phonetic text at an optimum distance above the specified range.
FontName Optional String The name of the font to use for the phonetic text. If no value is specified, Publisher uses the same font as the text in the specified range.
FontSize Optional Variant The font size to use for the phonetic text. Default is 10 point.

Return value

Field

Remarks

The Alignment parameter can be one of the PbPhoneticGuideAlignmentType constants declared in the Microsoft Publisher type library and shown in the following table.

Constant Description
pbPhoneticGuideAlignmentCenter Centers phonetic text over the specified range.
pbPhoneticGuideAlignmentDefault Centers phonetic text over the specified range. The default.
pbPhoneticGuideAlignmentLeft Left-aligns phonetic text with the specified range.
pbPhoneticGuideAlignmentOneTwoOne Adjusts the inside and outside spacing of the phonetic text in a 1:2:1 ratio.
pbPhoneticGuideAlignmentRight Right-aligns phonetic text with the specified range.
pbPhoneticGuideAlignmentZeroOneZero Adjusts the inside and outside spacing of the phonetic text in a 0:1:0 ratio.

Example

This example adds a phonetic guide to the selected phrase "very nice."

Sub PhoneticGuide() 
 Selection.TextRange.Fields.AddPhoneticGuide _ 
 Range:=Selection.TextRange, Text:="ver-E nIs", _ 
 Alignment:=pbPhoneticGuideAlignmentCenter, _ 
 Raise:=11, FontSize:=7 
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.