SPEECH vba coding!!

danoC

New Member
Joined
Nov 20, 2004
Messages
4
I have been looking at methods of implementing text to speech in excel 2003. So far I have seen only this:

Sub talk()
Application.Speech.Speak "Hello! Blah Blah Blah!"
End Sub

Unfortunately my needs are slightly more complicated...
I'm running a program which uses a stored database of names at specific times whenever a button is pressed on a userform. I would like to incorporate array names (strings) along with a constant repeating portion. For example:

"Thank you! (variable name) is the next item."

Does anyone have some coding that may help me with this task?
Anything will help, I haven't found much from Googling! :help:
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Looks like you are on the correct track. You can reference the variable in the speech text.

For example,
Code:
Sub FillArrayMulti_Talk()
    Dim intI As Integer, intJ As Integer
    Dim sngMulti(1 To 5, 1 To 10) As Single
    Dim vartalk As String
    
    ' Fill array with values.
    For intI = 1 To 5
        For intJ = 1 To 10
            sngMulti(intI, intJ) = intI * intJ
            Debug.Print sngMulti(intI, intJ)
        Next intJ
    Next intI
Debug.Print sngMulti(1, 5)
Application.Speech.Speak "Thank you!" & sngMulti(1, 5) & "is the next item."
End Sub

HTH,
CT
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top