Why does Application.Speech.Speak read some numbers individually rather than put them together?

后端 未结 3 995
日久生厌
日久生厌 2021-01-13 17:24

Let\'s suppose now it is 11h11min. It reads \"ONE ONE\" hours and \"eleven\" minutes, as in:

Sub TEST1() 
  Application.Speech.Speak \"It is \" & Hour(No         


        
3条回答
  •  清歌不尽
    2021-01-13 18:02

    Approach via SpeakXML argument

    Syntax

    .Speak(Text, SpeakAsync, SpeakXML, Purge)

    If you set the 3rd argument SpeakXML to True, you can use XML tags in your text string.

    The XML tag forces the voice to spell out all text, rather than using its default word and sentence breaking rules. All characters should be expanded to corresponding words (including punctuation, numbers, and so forth). Note that the tag mustn't be empty and don't forget the closing tag .

    Try to use the following with both variants of 11:

    Code

    Sub TEST()
      Application.Speech.Speak "It is " & "11" & " hours and " & "11" & " minutes", False, SpeakXML:=True
    End Sub
    

    Note/caveat

    I'm using a central European language Version and your example did'nt speak out ONE ONE in my case, so maybe there is another local setting issue.

提交回复
热议问题