Class Phonetic (Excel VBA)
Contains information about a specific phonetic text string in a cell. To use a Phonetic class variable it first needs to be instantiated, for example
Dim phn as Phonetic
Set phn = ActiveCell.Phonetic
For Each
Here is an example of processing the Phonetic items in a collection.
Dim phn As Phonetic
For Each phn In Application.Phonetics
Next phn
Alignment
Returns or sets a Long value that represents the alignment for the specified phonetic text or tick label.
ActiveCell.Phonetic.Alignment =
CharacterType
Returns or sets the type of phonetic text in the specified cell.
ActiveCell.Phonetics(1).CharacterType = xlHiragana
Font
Returns a Font object that represents the font of the specified object.
Dim fntFont As Font
Set fntFont = ActiveCell.Phonetic.Font
Text
Returns or sets the text for the specified object.
For the Phonetic object, this property returns or sets its phonetic text. You cannot set this property to Null.
ActiveCell.Phonetic.Text =
Visible
Returns or sets a Boolean value that determines whether the object is visible.
ActiveCell.Phonetic.Visible = True