Results 1 to 5 of 5

Command button in user form that will read text in Spanish.

Threaded View

  1. #1
    Registered User
    Join Date
    04-01-2017
    Location
    Burlingame, CA
    MS-Off Ver
    2013
    Posts
    11

    Command button in user form that will read text in Spanish.

    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
    Last edited by Matt_in_CA; 08-23-2017 at 01:02 PM. Reason: Fix cross post.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Disable Command Button in User form
    By Lclarke11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2015, 07:50 AM
  2. [SOLVED] Erratic User Form Command Button behavior
    By RonRich in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-30-2013, 11:32 AM
  3. [SOLVED] Confirm Command button on user form using VBA
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2013, 05:56 AM
  4. Want to add disply and edit command button in user form- :(
    By sinha.riteshabap in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2013, 03:21 AM
  5. Help to creat user form with command button
    By sheree08 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 04:10 PM
  6. User form RTE 13 when opening with a command button on a worksheet
    By iaingidley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-08-2011, 11:50 AM
  7. Command Button on User form for Printing
    By Anthony Slater in forum Excel General
    Replies: 2
    Last Post: 09-07-2005, 03:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1