Share via


Phonetics.Add Method

Excel Developer Reference

Adds phonetic text to the specified cell.

Syntax

expression.Add(Start, Length, Text)

expression   A variable that represents a Phonetics object.

Parameters

Name Required/Optional Data Type Description
Start Required Long The position that represents the first character in the specified cell.
Length Required Long The number of characters from the Start position to the end of the text in the cell.
Text Required String Collectively, the characters that represent the phonetic text in the cell.

Example

This example adds three phonetic text strings to the active cell. The example then sets the character type to Hiragana, sets the font color to blue, and sets the text to visible.

Visual Basic for Applications
  ActiveCell.FormulaR1C1 = "toukyoutotoukyoutotoukyoutoshibuyakushibuyakushibuyakuyoyogiyoyogiyoyogi"
ActiveCell.Phonetics.Add Start:=1, Length:=3, Text:="toukyouto toukyoutotoukyouto toukyoutotoukyouto toukyouto"
ActiveCell.Phonetics.Add Start:=4, Length:=3, Text:="shibuyaku shibuyakushibuyaku shibuyaku"
ActiveCell.Phonetics.CharacterType = xlHiragana
ActiveCell.Phonetics.Font.Color = vbBlue
ActiveCell.Phonetics.Visible = True

See Also