ISpeechVoiceStatus LastBookmark Property (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3

Interface: ISpeechVoiceStatus

LastBookmark Property

The LastBookmark property retrieves the text value of the last bookmark encountered by the text-to-speech (TTS) engine.

The text value of a bookmark is enclosed in an XML attribute called Mark.


Set: (This property is read-only)
Get: String = ISpeechVoiceStatus.LastBookmark


The owning object.
Set: (This property is read-only)
Get: A String variable returning the string value of the last bookmark.


The following Visual Basic form code demonstrates the use of the LastBookmark and LastBookmarkId properties. To run this code, create a form without any controls and paste the code into the form's Declarations section.

The code creates a voice that speaks a text stream containing two bookmarks, and then calls the Status method to get an ISpeechVoiceStatus object. The code then shows how these two properties return the bookmark text and display the format of the bookmark.

Option Explicit

Private Sub Form_Load()
    On Error GoTo EH

    Dim objVOICE As SpeechLib.SpVoice
    Dim objSTATUS As SpeechLib.ISpeechVoiceStatus

    Set objVOICE = New SpVoice

    objVOICE.Speak "<BOOKMARK MARK='1. Monday'/> monday " _
            & "<bookmark mark='2. Tuesday'/> tuesday ", SVSFIsXML

    Set objSTATUS = objVOICE.Status

    MsgBox "LastBookmark is " & objSTATUS.LastBookmark      ' "2. Tuesday"
    MsgBox "LastBookmarkId is " & objSTATUS.LastBookmarkId  ' "2"

    If Err.Number Then ShowErrMsg
End Sub

Private Sub ShowErrMsg()

    ' Declare identifiers:
    Dim T As String

    T = "Desc: " & Err.Description & vbNewLine
    T = T & "Err #: " & Err.Number
    MsgBox T, vbExclamation, "Run-Time Error"

End Sub
© 2015 Microsoft