Phonetic Object

Microsoft Excel Visual Basic

Phonetic Object

         
Range Phonetics (Phonetic)

Contains information about a specific phonetic text string in a cell. In Microsoft Excel 97, this object contained the formatting attributes for any phonetic text in the specified range.

Using the Phonetic Object

Use Phonetics(index), where index is the index number of the phonetic text, to return a single Phonetic object. The following example sets the first phonetic text string in the active cell to "furiganafuriganafuriganafurigana".

ActiveCell.Phonetics(1).Text = "furiganafuriganafuriganafurigana"

The Phonetic property provides compatibility with earlier versions of Microsoft Excel. You should use Phonetics(index), where index is the index number of the phonetic text, to return a single Phonetic object. To demonstrate compatibility with earlier versions of Microsoft Excel, the following example adds Furigana characters to the range A1:C4. If you add Furigana characters to a range, a new Phonetic object is automatically created.

With Range("A1:C4").Phonetic
    .CharacterType = xlHiragana
    .Alignment = xlPhoneticAlignCenter
    .Font.Name = "MS Pgoshikkugoshikkugoshikkugoshikku"
    .Font.FontStyle = "hyoujunhyoujun"
    .Font.Size = 6
    .Font.Strikethrough = False
    .Font.Underline = xlUnderlineStyleNone
    .Font.ColorIndex = xlAutomatic
    .Visible = True
End With