Greetings! And Thank You in advance for your help.
I am trying to write VBA code, under a command button in a form, that will read the text from a selected cell in Spanish.
I have not been able to get it to work, so I don't have sample code (for that) which I can show you.
I do have these.
This code, under a different command button in the same form,reads the text in English (works fine):
Private Sub CommandButton1_Click() 'English
Application.Speech.Speak Cells(1, 2).Value
End Sub
The below is a separate macro and function (which I got from http://wellsr.com/vba/2016/excel/mak...ech-speak-vba/) that reads text in Spanish perfectly. But I can't figure out how to get it into the form under the next command button.
Sub SpanishTalk() 'Reads text in Spanish using SuperTalk
Dim W As String
W = ActiveCell.Value
SuperTalk W, "GIRL", -1, 100
End Sub
Private Sub SuperTalk(Words As String, Person As String, Rate As Long, Volume As Long)
Dim Voc As SpeechLib.SpVoice
Set Voc = New SpVoice
With Voc
If UCase(Person) = "BOY" Then
Set .Voice = .GetVoices.Item(0)
ElseIf UCase(Person) = "GIRL" Then
Set .Voice = .GetVoices.Item(2)
End If
.Rate = Rate
.Volume = Volume
.Speak Words
End With
End Sub
Basically, I'm building a user form with a button that will read a selected text in English. And with a second button that will read a different selected text in Spanish. I've got the first (English) button. But not the second (Spanish) button.
Also posted in separate forum: http://www.ozgrid.com/forum/showthread.php?t=205306
Thanks,
Matt_in_CA
Bookmarks